mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-03 17:32:59 +00:00
Add an option to turn off the expensive GVN load PRE part of GVN.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153902 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
29f60f359b
commit
3197b4453d
@ -131,8 +131,9 @@ public:
|
|||||||
/// populateModulePassManager - This sets up the primary pass manager.
|
/// populateModulePassManager - This sets up the primary pass manager.
|
||||||
void populateModulePassManager(PassManagerBase &MPM);
|
void populateModulePassManager(PassManagerBase &MPM);
|
||||||
void populateLTOPassManager(PassManagerBase &PM, bool Internalize,
|
void populateLTOPassManager(PassManagerBase &PM, bool Internalize,
|
||||||
bool RunInliner);
|
bool RunInliner, bool DisableGVNLoadPRE = false);
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Registers a function for adding a standard set of passes. This should be
|
/// Registers a function for adding a standard set of passes. This should be
|
||||||
/// used by optimizer plugins to allow all front ends to transparently use
|
/// used by optimizer plugins to allow all front ends to transparently use
|
||||||
/// them. Create a static instance of this class in your plugin, providing a
|
/// them. Create a static instance of this class in your plugin, providing a
|
||||||
@ -143,5 +144,6 @@ struct RegisterStandardPasses {
|
|||||||
PassManagerBuilder::addGlobalExtension(Ty, Fn);
|
PassManagerBuilder::addGlobalExtension(Ty, Fn);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace llvm
|
} // end namespace llvm
|
||||||
#endif
|
#endif
|
||||||
|
@ -207,7 +207,8 @@ void PassManagerBuilder::populateModulePassManager(PassManagerBase &MPM) {
|
|||||||
|
|
||||||
void PassManagerBuilder::populateLTOPassManager(PassManagerBase &PM,
|
void PassManagerBuilder::populateLTOPassManager(PassManagerBase &PM,
|
||||||
bool Internalize,
|
bool Internalize,
|
||||||
bool RunInliner) {
|
bool RunInliner,
|
||||||
|
bool DisableGVNLoadPRE) {
|
||||||
// Provide AliasAnalysis services for optimizations.
|
// Provide AliasAnalysis services for optimizations.
|
||||||
addInitialAliasAnalysisPasses(PM);
|
addInitialAliasAnalysisPasses(PM);
|
||||||
|
|
||||||
@ -263,9 +264,9 @@ void PassManagerBuilder::populateLTOPassManager(PassManagerBase &PM,
|
|||||||
PM.add(createFunctionAttrsPass()); // Add nocapture.
|
PM.add(createFunctionAttrsPass()); // Add nocapture.
|
||||||
PM.add(createGlobalsModRefPass()); // IP alias analysis.
|
PM.add(createGlobalsModRefPass()); // IP alias analysis.
|
||||||
|
|
||||||
PM.add(createLICMPass()); // Hoist loop invariants.
|
PM.add(createLICMPass()); // Hoist loop invariants.
|
||||||
PM.add(createGVNPass()); // Remove redundancies.
|
PM.add(createGVNPass(DisableGVNLoadPRE)); // Remove redundancies.
|
||||||
PM.add(createMemCpyOptPass()); // Remove dead memcpys.
|
PM.add(createMemCpyOptPass()); // Remove dead memcpys.
|
||||||
// Nuke dead stores.
|
// Nuke dead stores.
|
||||||
PM.add(createDeadStoreEliminationPass());
|
PM.add(createDeadStoreEliminationPass());
|
||||||
|
|
||||||
|
@ -49,6 +49,9 @@ using namespace llvm;
|
|||||||
static cl::opt<bool> DisableInline("disable-inlining",
|
static cl::opt<bool> DisableInline("disable-inlining",
|
||||||
cl::desc("Do not run the inliner pass"));
|
cl::desc("Do not run the inliner pass"));
|
||||||
|
|
||||||
|
static cl::opt<bool> DisableGVNLoadPRE("disable-gvn-loadpre",
|
||||||
|
cl::desc("Do not run the GVN load PRE pass"));
|
||||||
|
|
||||||
const char* LTOCodeGenerator::getVersionString() {
|
const char* LTOCodeGenerator::getVersionString() {
|
||||||
#ifdef LLVM_VERSION_INFO
|
#ifdef LLVM_VERSION_INFO
|
||||||
return PACKAGE_NAME " version " PACKAGE_VERSION ", " LLVM_VERSION_INFO;
|
return PACKAGE_NAME " version " PACKAGE_VERSION ", " LLVM_VERSION_INFO;
|
||||||
@ -353,7 +356,8 @@ bool LTOCodeGenerator::generateObjectFile(raw_ostream &out,
|
|||||||
passes.add(new TargetData(*_target->getTargetData()));
|
passes.add(new TargetData(*_target->getTargetData()));
|
||||||
|
|
||||||
PassManagerBuilder().populateLTOPassManager(passes, /*Internalize=*/ false,
|
PassManagerBuilder().populateLTOPassManager(passes, /*Internalize=*/ false,
|
||||||
!DisableInline);
|
!DisableInline,
|
||||||
|
DisableGVNLoadPRE);
|
||||||
|
|
||||||
// Make sure everything is still good.
|
// Make sure everything is still good.
|
||||||
passes.add(createVerifierPass());
|
passes.add(createVerifierPass());
|
||||||
|
Loading…
Reference in New Issue
Block a user