summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Support/StandardPasses.h10
-rw-r--r--tools/llvm-ld/Optimize.cpp2
-rw-r--r--tools/lto/LTOCodeGenerator.cpp1
3 files changed, 3 insertions, 10 deletions
diff --git a/include/llvm/Support/StandardPasses.h b/include/llvm/Support/StandardPasses.h
index 024c0194d4..5c63034a86 100644
--- a/include/llvm/Support/StandardPasses.h
+++ b/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.
diff --git a/tools/llvm-ld/Optimize.cpp b/tools/llvm-ld/Optimize.cpp
index a4ca95199a..e4668958db 100644
--- a/tools/llvm-ld/Optimize.cpp
+++ b/tools/llvm-ld/Optimize.cpp
@@ -94,7 +94,7 @@ void Optimize(Module* M) {
if (!DisableOptimizations)
createStandardLTOPasses(&Passes, !DisableInternalize, !DisableInline,
- /*RunSecondGlobalOpt=*/true, VerifyEach);
+ VerifyEach);
// If the -s or -S command line options were specified, strip the symbols out
// of the resulting program to make it smaller. -s and -S are GNU ld options
diff --git a/tools/lto/LTOCodeGenerator.cpp b/tools/lto/LTOCodeGenerator.cpp
index 03a11b687d..dcbae95bd6 100644
--- a/tools/lto/LTOCodeGenerator.cpp
+++ b/tools/lto/LTOCodeGenerator.cpp
@@ -391,7 +391,6 @@ bool LTOCodeGenerator::generateAssemblyCode(raw_ostream& out,
passes.add(new TargetData(*_target->getTargetData()));
createStandardLTOPasses(&passes, /*Internalize=*/ false, !DisableInline,
- /*RunSecondGlobalOpt=*/ false,
/*VerifyEach=*/ false);
// Make sure everything is still good.