diff options
author | Chris Lattner <sabre@nondot.org> | 2009-11-01 20:41:59 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-11-01 20:41:59 +0000 |
commit | f51635cd30232ecfcbe1094ceaf85118abe0f0f6 (patch) | |
tree | ea6f31872993f1c945ba4ca932631039e5005c51 | |
parent | 213a8d3a481e0166d0397b09f0d7694cafee5af1 (diff) | |
download | external_llvm-f51635cd30232ecfcbe1094ceaf85118abe0f0f6.zip external_llvm-f51635cd30232ecfcbe1094ceaf85118abe0f0f6.tar.gz external_llvm-f51635cd30232ecfcbe1094ceaf85118abe0f0f6.tar.bz2 |
fix two strange things in the default passmgr:
1. we'd run simplifycfg at the very start, even though
the per function passes have already cleaned this up.
2. In the main per-function pipeline that is interlaced with inlining
etc, we would do instcombine, jump threading, simplifycfg *before*
doing SROA. SROA is much more likely to expose opportunities for
these passes than they are for SROA, so move SRoA up earlier.
also add some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85742 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Support/StandardPasses.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/llvm/Support/StandardPasses.h b/include/llvm/Support/StandardPasses.h index ffa9314..86065a0 100644 --- a/include/llvm/Support/StandardPasses.h +++ b/include/llvm/Support/StandardPasses.h @@ -96,7 +96,6 @@ namespace llvm { return; } - PM->add(createCFGSimplificationPass()); // Clean up disgusting code if (UnitAtATime) { PM->add(createGlobalOptimizerPass()); // Optimize out global vars @@ -106,6 +105,8 @@ namespace llvm { } PM->add(createInstructionCombiningPass()); // Clean up after IPCP & DAE PM->add(createCFGSimplificationPass()); // Clean up after IPCP & DAE + + // Start of CallGraph SCC passes. if (UnitAtATime) { if (HaveExceptions) PM->add(createPruneEHPass()); // Remove dead EH info @@ -115,13 +116,18 @@ namespace llvm { PM->add(InliningPass); if (OptimizationLevel > 2) PM->add(createArgumentPromotionPass()); // Scalarize uninlined fn args + + // Start of function pass. + + PM->add(createScalarReplAggregatesPass()); // Break up aggregate allocas if (SimplifyLibCalls) PM->add(createSimplifyLibCallsPass()); // Library Call Optimizations PM->add(createInstructionCombiningPass()); // Cleanup for scalarrepl. PM->add(createJumpThreadingPass()); // Thread jumps. PM->add(createCFGSimplificationPass()); // Merge & remove BBs - PM->add(createScalarReplAggregatesPass()); // Break up aggregate allocas PM->add(createInstructionCombiningPass()); // Combine silly seq's + + // FIXME: CondProp breaks critical edges, which is slow. PM->add(createCondPropagationPass()); // Propagate conditionals PM->add(createTailCallEliminationPass()); // Eliminate tail calls PM->add(createCFGSimplificationPass()); // Merge & remove BBs |