summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-06-03 21:51:32 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-06-03 21:51:32 +0000
commit3cd724e5906e150c2408b38cb3555c32c136256a (patch)
treef1a18f98c50f3421608c8a57221c1cd1ac354787 /llvm/include
parentee06b752f09611656044a7d19ad1b5a68dfc6b77 (diff)
downloadbcm5719-llvm-3cd724e5906e150c2408b38cb3555c32c136256a.tar.gz
bcm5719-llvm-3cd724e5906e150c2408b38cb3555c32c136256a.zip
Change LTO to run the global opt pass twice.
- This matches llvm-ld. It took a bit of archeology to figure out what the right thing to do was (whether this was intentionally added or intentionally removed). My final conclusion is that Chris added this intentionally here: http://llvm.org/viewvc/llvm-project?view=rev&revision=16913 but the changes weren't propogated to llvm-ld until here: http://llvm.org/viewvc/llvm-project?view=rev&revision=34058 which was after lto.cpp had been cloned off (of llvm-ld), here: http://llvm.org/viewvc/llvm-project?view=rev&revision=29494 From the commit message, it looks like the motivation for running global opt again is because we ran it prior to inlining. Based on that I updated the comment and also only run the pass if we actually ran the inliner. Chris, please review. llvm-svn: 72811
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/Support/StandardPasses.h10
1 files changed, 2 insertions, 8 deletions
diff --git a/llvm/include/llvm/Support/StandardPasses.h b/llvm/include/llvm/Support/StandardPasses.h
index 024c0194d4e..5c63034a863 100644
--- a/llvm/include/llvm/Support/StandardPasses.h
+++ b/llvm/include/llvm/Support/StandardPasses.h
@@ -60,15 +60,10 @@ namespace llvm {
///
/// Internalize - Run the internalize pass.
/// RunInliner - Use a function inlining pass.
- /// RunSecondGlobalOpt - Run the global optimizer pass twice.
/// VerifyEach - Run the verifier after each pass.
- //
- // FIXME: RunSecondGlobalOpt should go away once we resolve which of LTO or
- // llvm-ld is better.
static inline void createStandardLTOPasses(PassManager *PM,
bool Internalize,
bool RunInliner,
- bool RunSecondGlobalOpt,
bool VerifyEach);
// Implementations
@@ -173,7 +168,6 @@ namespace llvm {
static inline void createStandardLTOPasses(PassManager *PM,
bool Internalize,
bool RunInliner,
- bool RunSecondGlobalOpt,
bool VerifyEach) {
// Now that composite has been compiled, scan through the module, looking
// for a main function. If main is defined, mark all other functions
@@ -207,8 +201,8 @@ namespace llvm {
addOnePass(PM, createFunctionInliningPass(), VerifyEach);
addOnePass(PM, createPruneEHPass(), VerifyEach); // Remove dead EH info.
- // Optimize globals again.
- if (RunSecondGlobalOpt)
+ // Optimize globals again if we ran the inliner.
+ if (RunInliner)
addOnePass(PM, createGlobalOptimizerPass(), VerifyEach);
addOnePass(PM, createGlobalDCEPass(), VerifyEach); // Remove dead functions.
OpenPOWER on IntegriCloud