diff options
author | Dan Gohman <gohman@apple.com> | 2009-11-20 02:03:44 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-11-20 02:03:44 +0000 |
commit | 2e7e94826a4cf6715b4c07d779fb84994c0bc47b (patch) | |
tree | eea913380f9c0a517ae91234a5679b03e39dbf01 /lib/CodeGen/LLVMTargetMachine.cpp | |
parent | ae079c250ff7bacf872b339ee08b65c7b7823e39 (diff) |
Add an experimental option to run gep-splitting and no-load GVN
just before codegen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89439 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LLVMTargetMachine.cpp')
-rw-r--r-- | lib/CodeGen/LLVMTargetMachine.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/CodeGen/LLVMTargetMachine.cpp b/lib/CodeGen/LLVMTargetMachine.cpp index 0db459bb91..8800f22beb 100644 --- a/lib/CodeGen/LLVMTargetMachine.cpp +++ b/lib/CodeGen/LLVMTargetMachine.cpp @@ -66,6 +66,11 @@ static cl::opt<cl::boolOrDefault> EnableFastISelOption("fast-isel", cl::Hidden, cl::desc("Enable the \"fast\" instruction selector")); +// Enable or disable an experimental optimization to split GEPs +// and run a special GVN pass which does not examine loads, in +// an effort to factor out redundancy implicit in complex GEPs. +static cl::opt<bool> EnableSplitGEPGVN("split-gep-gvn", cl::Hidden, + cl::desc("Split GEPs and run no-load GVN")); LLVMTargetMachine::LLVMTargetMachine(const Target &T, const std::string &TargetTriple) @@ -223,6 +228,12 @@ bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM, CodeGenOpt::Level OptLevel) { // Standard LLVM-Level Passes. + // Optionally, tun split-GEPs and no-load GVN. + if (EnableSplitGEPGVN) { + PM.add(createGEPSplitterPass()); + PM.add(createGVNPass(/*NoPRE=*/false, /*NoLoads=*/true)); + } + // Run loop strength reduction before anything else. if (OptLevel != CodeGenOpt::None && !DisableLSR) { PM.add(createLoopStrengthReducePass(getTargetLowering())); |