aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2009-10-27 23:49:38 +0000
committerBob Wilson <bob.wilson@apple.com>2009-10-27 23:49:38 +0000
commitcd4f04d6bcb7aefa24d92582fbadfe17519f4756 (patch)
tree154762d67c0c4a8d677aeef3bd023b5a1f0f719a /include
parent03236140fa4ef316a605717e090276d6a0d42828 (diff)
downloadexternal_llvm-cd4f04d6bcb7aefa24d92582fbadfe17519f4756.zip
external_llvm-cd4f04d6bcb7aefa24d92582fbadfe17519f4756.tar.gz
external_llvm-cd4f04d6bcb7aefa24d92582fbadfe17519f4756.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85346 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/Passes.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/llvm/CodeGen/Passes.h b/include/llvm/CodeGen/Passes.h
index d0d6103..78fa8fe 100644
--- a/include/llvm/CodeGen/Passes.h
+++ b/include/llvm/CodeGen/Passes.h
@@ -127,10 +127,11 @@ namespace llvm {
/// optimizations to delete branches to branches, eliminate branches to
/// successor blocks (creating fall throughs), and eliminating branches over
/// branches.
- FunctionPass *createBranchFoldingPass(bool DefaultEnableTailMerge);
+ FunctionPass *createBranchFoldingPass(bool DefaultEnableTailMerge,
+ CodeGenOpt::Level OptLevel);
- /// IfConverter Pass - This pass performs machine code if conversion.
- FunctionPass *createIfConverterPass();
+ /// IfConverter Pass - This pass performs machine code if-conversion.
+ FunctionPass *createIfConverterPass(CodeGenOpt::Level OptLevel);
/// Code Placement Pass - This pass optimize code placement and aligns loop
/// headers to target specific alignment boundary.