mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-28 03:25:23 +00:00
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
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user