[llvm] r260606 - Revert "Define the ThinLTO Pipeline"
Mehdi Amini via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 11 14:09:07 PST 2016
Author: mehdi_amini
Date: Thu Feb 11 16:09:07 2016
New Revision: 260606
URL: http://llvm.org/viewvc/llvm-project?rev=260606&view=rev
Log:
Revert "Define the ThinLTO Pipeline"
This reverts commit r260604.
I didn't intend to push this now.
From: Mehdi Amini <mehdi.amini at apple.com>
Modified:
llvm/trunk/include/llvm/Transforms/IPO/PassManagerBuilder.h
llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp
Modified: llvm/trunk/include/llvm/Transforms/IPO/PassManagerBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/IPO/PassManagerBuilder.h?rev=260606&r1=260605&r2=260606&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/IPO/PassManagerBuilder.h (original)
+++ llvm/trunk/include/llvm/Transforms/IPO/PassManagerBuilder.h Thu Feb 11 16:09:07 2016
@@ -133,8 +133,6 @@ public:
bool VerifyOutput;
bool MergeFunctions;
bool PrepareForLTO;
- bool PrepareForThinLTO;
- bool PerformThinLTO;
/// Profile data file name that the instrumentation will be written to.
std::string PGOInstrGen;
@@ -172,7 +170,6 @@ public:
/// populateModulePassManager - This sets up the primary pass manager.
void populateModulePassManager(legacy::PassManagerBase &MPM);
void populateLTOPassManager(legacy::PassManagerBase &PM);
- void populateThinLTOPassManager(legacy::PassManagerBase &PM);
};
/// Registers a function for adding a standard set of passes. This should be
Modified: llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp?rev=260606&r1=260605&r2=260606&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp Thu Feb 11 16:09:07 2016
@@ -140,8 +140,6 @@ PassManagerBuilder::PassManagerBuilder()
PrepareForLTO = false;
PGOInstrGen = RunPGOInstrGen;
PGOInstrUse = RunPGOInstrUse;
- PrepareForThinLTO = false;
- PerformThinLTO = false;
}
PassManagerBuilder::~PassManagerBuilder() {
@@ -235,11 +233,6 @@ void PassManagerBuilder::addFunctionSimp
MPM.add(createTailCallEliminationPass()); // Eliminate tail calls
MPM.add(createCFGSimplificationPass()); // Merge & remove BBs
MPM.add(createReassociatePass()); // Reassociate expressions
- if (PrepareForThinLTO) {
- MPM.add(createAggressiveDCEPass()); // Delete dead instructions
- MPM.add(createInstructionCombiningPass()); // Combine silly seq's
- return;
- }
// Rotate Loop - disable header duplication at -Oz
MPM.add(createLoopRotatePass(SizeLevel == 2 ? 0 : -1));
MPM.add(createLICMPass()); // Hoist loop invariants
@@ -353,12 +346,6 @@ void PassManagerBuilder::populateModuleP
MPM.add(createIPSCCPPass()); // IP SCCP
MPM.add(createGlobalOptimizerPass()); // Optimize out global vars
-
- if (PerformThinLTO)
- // Linking modules together can lead to duplicated global constants, only
- // keep one copy of each constant.
- MPM.add(createConstantMergePass());
-
// Promote any localized global vars
MPM.add(createPromoteMemoryToRegisterPass());
@@ -391,12 +378,6 @@ void PassManagerBuilder::populateModuleP
addFunctionSimplificationPasses(MPM);
- // If we are planning to perform ThinLTO later, let's not bloat the code with
- // unrolling/vectorization/... now. We'll first run the inliner + CGSCC passes
- // during ThinLTO and performs the rest of the optimizations afterward.
- if (PrepareForThinLTO)
- return;
-
// FIXME: This is a HACK! The inliner pass above implicitly creates a CGSCC
// pass manager that we are specifically trying to avoid. To prevent this
// we must insert a no-op module pass to reset the pass manager.
@@ -415,7 +396,7 @@ void PassManagerBuilder::populateModuleP
if (!DisableUnitAtATime)
MPM.add(createReversePostOrderFunctionAttrsPass());
- if (!DisableUnitAtATime && OptLevel > 1 && !PrepareForLTO)
+ if (!DisableUnitAtATime && OptLevel > 1 && !PrepareForLTO) {
// Remove avail extern fns and globals definitions if we aren't
// compiling an object file for later LTO. For LTO we want to preserve
// these so they are eligible for inlining at link-time. Note if they
@@ -426,15 +407,6 @@ void PassManagerBuilder::populateModuleP
// globals referenced by available external functions dead
// and saves running remaining passes on the eliminated functions.
MPM.add(createEliminateAvailableExternallyPass());
-
- if (PerformThinLTO) {
- // Remove dead fns and globals. Removing unreferenced functions could lead
- // to more opportunities for globalopt
- MPM.add(createGlobalDCEPass());
- MPM.add(createGlobalOptimizerPass());
- // Remove dead fns and globals after globalopt
- MPM.add(createGlobalDCEPass());
- addFunctionSimplificationPasses(MPM);
}
if (EnableNonLTOGlobalsModRef)
@@ -710,20 +682,6 @@ void PassManagerBuilder::addLateLTOOptim
PM.add(createMergeFunctionsPass());
}
-void PassManagerBuilder::populateThinLTOPassManager(
- legacy::PassManagerBase &PM) {
- PerformThinLTO = true;
-
- if (VerifyInput)
- PM.add(createVerifierPass());
-
- populateModulePassManager(PM);
-
- if (VerifyOutput)
- PM.add(createVerifierPass());
- PerformThinLTO = false;
-}
-
void PassManagerBuilder::populateLTOPassManager(legacy::PassManagerBase &PM) {
if (LibraryInfo)
PM.add(new TargetLibraryInfoWrapperPass(*LibraryInfo));
More information about the llvm-commits
mailing list