summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2012-09-28 21:23:26 +0000
committerEvan Cheng <evan.cheng@apple.com>2012-09-28 21:23:26 +0000
commit8c6b06d4a07659fb0a3647456961095a31568199 (patch)
tree7e96fe4e1422f3539e5034266a80323e243ca18d /llvm/lib/Transforms
parent044d028e3c922ed5e9ee3cf3d7624aa332cdf430 (diff)
downloadbcm5719-llvm-8c6b06d4a07659fb0a3647456961095a31568199.tar.gz
bcm5719-llvm-8c6b06d4a07659fb0a3647456961095a31568199.zip
GlobalDCE should be run at -O2 / -Os to eliminate unused dtor, etc. rdar://9142819
llvm-svn: 164850
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/PassManagerBuilder.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
index c81b333813e..9e328b9ac97 100644
--- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
+++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
@@ -211,13 +211,12 @@ void PassManagerBuilder::populateModulePassManager(PassManagerBase &MPM) {
// FIXME: We shouldn't bother with this anymore.
MPM.add(createStripDeadPrototypesPass()); // Get rid of dead prototypes
- // GlobalOpt already deletes dead functions and globals, at -O3 try a
+ // GlobalOpt already deletes dead functions and globals, at -O2 try a
// late pass of GlobalDCE. It is capable of deleting dead cycles.
- if (OptLevel > 2)
+ if (OptLevel > 1) {
MPM.add(createGlobalDCEPass()); // Remove dead fns and globals.
-
- if (OptLevel > 1)
MPM.add(createConstantMergePass()); // Merge dup global constants
+ }
}
addExtensionsToPM(EP_OptimizerLast, MPM);
}
OpenPOWER on IntegriCloud