diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-12-04 09:42:45 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-12-04 09:42:45 +0000 |
commit | 6154dbd5ee47a711223b5f6b9705d04e885223af (patch) | |
tree | 3c3a6cfbf91664299c2155d9a9f81918650055a7 /llvm/lib/CodeGen/LLVMTargetMachine.cpp | |
parent | 0f1cc35c65d4ae15b41a24fd9e8997e25b9fb6e1 (diff) | |
download | bcm5719-llvm-6154dbd5ee47a711223b5f6b9705d04e885223af.tar.gz bcm5719-llvm-6154dbd5ee47a711223b5f6b9705d04e885223af.zip |
Add a pre-regalloc tail duplication pass.
llvm-svn: 90567
Diffstat (limited to 'llvm/lib/CodeGen/LLVMTargetMachine.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LLVMTargetMachine.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp index 242cba5b64e..297dd316762 100644 --- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp +++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp @@ -74,6 +74,9 @@ EnableFastISelOption("fast-isel", cl::Hidden, static cl::opt<bool> EnableSplitGEPGVN("split-gep-gvn", cl::Hidden, cl::desc("Split GEPs and run no-load GVN")); +static cl::opt<bool> PreAllocTailDup("pre-regalloc-taildup", cl::Hidden, + cl::desc("Pre-register allocation tail duplication")); + LLVMTargetMachine::LLVMTargetMachine(const Target &T, const std::string &TargetTriple) : TargetMachine(T) { @@ -302,6 +305,13 @@ bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM, /* allowDoubleDefs= */ true); } + // Pre-ra tail duplication. + if (OptLevel != CodeGenOpt::None && + !DisableTailDuplicate && PreAllocTailDup) { + PM.add(createTailDuplicatePass(true)); + printAndVerify(PM, "After Pre-RegAlloc TailDuplicate"); + } + // Run pre-ra passes. if (addPreRegAlloc(PM, OptLevel)) printAndVerify(PM, "After PreRegAlloc passes", @@ -348,7 +358,7 @@ bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM, // Tail duplication. if (OptLevel != CodeGenOpt::None && !DisableTailDuplicate) { - PM.add(createTailDuplicatePass()); + PM.add(createTailDuplicatePass(false)); printAndVerify(PM, "After TailDuplicate"); } |