Mercurial > hg > CbC > CbC_llvm
changeset 166:3a3539a2fb79
...
author | anatofuz |
---|---|
date | Tue, 24 Mar 2020 17:18:49 +0900 |
parents | 597b3f1c2c93 |
children | e037d1dd7369 |
files | llvm/lib/Passes/PassBuilder.cpp llvm/lib/Transforms/IPO/PassManagerBuilder.cpp |
diffstat | 2 files changed, 10 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/llvm/lib/Passes/PassBuilder.cpp Tue Mar 24 15:30:52 2020 +0900 +++ b/llvm/lib/Passes/PassBuilder.cpp Tue Mar 24 17:18:49 2020 +0900 @@ -450,8 +450,13 @@ FPM.addPass(PGOMemOPSizeOpt()); // TODO: Investigate the cost/benefit of tail call elimination on debugging. +#ifndef noCbC + FPM.addPass(SROA()); + FPM.addPass(TailCallElimPass()); +#else if (Level.getSpeedupLevel() > 1) FPM.addPass(TailCallElimPass()); +#endif FPM.addPass(SimplifyCFGPass()); // Form canonically associated expression trees, and simplify the trees using
--- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp Tue Mar 24 15:30:52 2020 +0900 +++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp Tue Mar 24 17:18:49 2020 +0900 @@ -396,12 +396,11 @@ // Optimize memory intrinsic calls based on the profiled size information. if (SizeLevel == 0) MPM.add(createPGOMemOPSizeOptLegacyPass()); + + // TODO: Investigate the cost/benefit of tail call elimination on debugging. #ifndef noCbc - MPM.add(createTailCallEliminationPass(false)); // CbC -#endif - - // TODO: Investigate the cost/benefit of tail call elimination on debugging. -#ifdef noCbC + MPM.add(createTailCallEliminationPass(false)); // CbC +#else if (OptLevel > 1) MPM.add(createTailCallEliminationPass()); // Eliminate tail calls #endif @@ -995,7 +994,7 @@ // LTO provides additional opportunities for tailcall elimination due to // link-time inlining, and visibility of nocapture attribute. #ifndef noCbC - PM.add(createTailCallEliminationPass(false)); + PM.add(createTailCallEliminationPass(true)); #else if (OptLevel > 1) PM.add(createTailCallEliminationPass());