diff options
author | Bob Wilson <bob.wilson@apple.com> | 2009-10-27 23:49:38 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2009-10-27 23:49:38 +0000 |
commit | 9693f9d465479d54db45052fb3604cb6c2d9d32d (patch) | |
tree | 563b86213d2250ef59c97f144fa1f1c88cc453eb /llvm/lib/CodeGen/LLVMTargetMachine.cpp | |
parent | bb9ff05778b70d8d783abb4703f3ac38cd1d6720 (diff) | |
download | bcm5719-llvm-9693f9d465479d54db45052fb3604cb6c2d9d32d.tar.gz bcm5719-llvm-9693f9d465479d54db45052fb3604cb6c2d9d32d.zip |
Record CodeGen optimization level in the BranchFolding pass so that we can
use it to control tail merging when there is a tradeoff between performance
and code size. When there is only 1 instruction in the common tail, we have
been merging. That can be good for code size but is a definite loss for
performance. Now we will avoid tail merging in that case when the
optimization level is "Aggressive", i.e., "-O3". Radar 7338114.
Since the IfConversion pass invokes BranchFolding, it too needs to know
the optimization level. Note that I removed the RegisterPass instantiation
for IfConversion because it required a default constructor. If someone
wants to keep that for some reason, we can add a default constructor with
a hard-wired optimization level.
llvm-svn: 85346
Diffstat (limited to 'llvm/lib/CodeGen/LLVMTargetMachine.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LLVMTargetMachine.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp index e58a9ca82c6..1a2daef24c1 100644 --- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp +++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp @@ -329,7 +329,7 @@ bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM, // Branch folding must be run after regalloc and prolog/epilog insertion. if (OptLevel != CodeGenOpt::None) { - PM.add(createBranchFoldingPass(getEnableTailMergeDefault())); + PM.add(createBranchFoldingPass(getEnableTailMergeDefault(), OptLevel)); printAndVerify(PM); } |