summaryrefslogtreecommitdiff
path: root/include/llvm/Support/StandardPasses.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2011-05-02 19:34:44 +0000
committerDimitry Andric <dim@FreeBSD.org>2011-05-02 19:34:44 +0000
commit6b943ff3a3f8617113ecbf611cf0f8957e4e19d2 (patch)
treefc5f365fb9035b2d0c622bbf06c9bbe8627d7279 /include/llvm/Support/StandardPasses.h
parentd0e4e96dc17a6c1c6de3340842c80f0e187ba349 (diff)
Notes
Diffstat (limited to 'include/llvm/Support/StandardPasses.h')
-rw-r--r--include/llvm/Support/StandardPasses.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/llvm/Support/StandardPasses.h b/include/llvm/Support/StandardPasses.h
index d774faf38642..8dfd6f98abfd 100644
--- a/include/llvm/Support/StandardPasses.h
+++ b/include/llvm/Support/StandardPasses.h
@@ -72,6 +72,7 @@ namespace llvm {
Pass *InliningPass) {
createStandardAliasAnalysisPasses(PM);
+ // If all optimizations are disabled, just run the always-inline pass.
if (OptimizationLevel == 0) {
if (InliningPass)
PM->add(InliningPass);
@@ -83,9 +84,10 @@ namespace llvm {
PM->add(createIPSCCPPass()); // IP SCCP
PM->add(createDeadArgEliminationPass()); // Dead argument elimination
+
+ PM->add(createInstructionCombiningPass());// Clean up after IPCP & DAE
+ PM->add(createCFGSimplificationPass()); // Clean up after IPCP & DAE
}
- PM->add(createInstructionCombiningPass()); // Clean up after IPCP & DAE
- PM->add(createCFGSimplificationPass()); // Clean up after IPCP & DAE
// Start of CallGraph SCC passes.
if (UnitAtATime && HaveExceptions)
@@ -120,7 +122,6 @@ namespace llvm {
PM->add(createLoopDeletionPass()); // Delete dead loops
if (UnrollLoops)
PM->add(createLoopUnrollPass()); // Unroll small loops
- PM->add(createInstructionCombiningPass()); // Clean up after the unroller
if (OptimizationLevel > 1)
PM->add(createGVNPass()); // Remove redundancies
PM->add(createMemCpyOptPass()); // Remove memcpy / form memset
@@ -134,6 +135,7 @@ namespace llvm {
PM->add(createDeadStoreEliminationPass()); // Delete dead stores
PM->add(createAggressiveDCEPass()); // Delete dead instructions
PM->add(createCFGSimplificationPass()); // Merge & remove BBs
+ PM->add(createInstructionCombiningPass()); // Clean up after everything.
if (UnitAtATime) {
PM->add(createStripDeadPrototypesPass()); // Get rid of dead prototypes