Skip to content

Commit 2e6ac54

Browse files
committed
[LegacyPM] Remove ThinLTO/LTO pipelines
Using the legacy PM for the optimization pipeline was deprecated in 13.0.0. Following recent changes to remove non-core features of the legacy PM/optimization pipeline, remove the (Thin)LTO pipelines. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D123882
1 parent a7e20a8 commit 2e6ac54

File tree

4 files changed

+0
-107
lines changed

4 files changed

+0
-107
lines changed

llvm/include/llvm-c/Transforms/PassManagerBuilder.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,6 @@ void
7272
LLVMPassManagerBuilderPopulateModulePassManager(LLVMPassManagerBuilderRef PMB,
7373
LLVMPassManagerRef PM);
7474

75-
/** See llvm::PassManagerBuilder::populateLTOPassManager. */
76-
void LLVMPassManagerBuilderPopulateLTOPassManager(LLVMPassManagerBuilderRef PMB,
77-
LLVMPassManagerRef PM,
78-
LLVMBool Internalize,
79-
LLVMBool RunInliner);
80-
8175
/**
8276
* @}
8377
*/

llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,6 @@ class PassManagerBuilder {
224224

225225
/// populateModulePassManager - This sets up the primary pass manager.
226226
void populateModulePassManager(legacy::PassManagerBase &MPM);
227-
void populateLTOPassManager(legacy::PassManagerBase &PM);
228-
void populateThinLTOPassManager(legacy::PassManagerBase &PM);
229227
};
230228

231229
/// Registers a function for adding a standard set of passes. This should be

llvm/lib/Transforms/IPO/PassManagerBuilder.cpp

Lines changed: 0 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,80 +1092,6 @@ void PassManagerBuilder::addLateLTOOptimizationPasses(
10921092
PM.add(createMergeFunctionsPass());
10931093
}
10941094

1095-
void PassManagerBuilder::populateThinLTOPassManager(
1096-
legacy::PassManagerBase &PM) {
1097-
PerformThinLTO = true;
1098-
if (LibraryInfo)
1099-
PM.add(new TargetLibraryInfoWrapperPass(*LibraryInfo));
1100-
1101-
if (VerifyInput)
1102-
PM.add(createVerifierPass());
1103-
1104-
if (ImportSummary) {
1105-
// This pass imports type identifier resolutions for whole-program
1106-
// devirtualization and CFI. It must run early because other passes may
1107-
// disturb the specific instruction patterns that these passes look for,
1108-
// creating dependencies on resolutions that may not appear in the summary.
1109-
//
1110-
// For example, GVN may transform the pattern assume(type.test) appearing in
1111-
// two basic blocks into assume(phi(type.test, type.test)), which would
1112-
// transform a dependency on a WPD resolution into a dependency on a type
1113-
// identifier resolution for CFI.
1114-
//
1115-
// Also, WPD has access to more precise information than ICP and can
1116-
// devirtualize more effectively, so it should operate on the IR first.
1117-
PM.add(createWholeProgramDevirtPass(nullptr, ImportSummary));
1118-
PM.add(createLowerTypeTestsPass(nullptr, ImportSummary));
1119-
}
1120-
1121-
populateModulePassManager(PM);
1122-
1123-
if (VerifyOutput)
1124-
PM.add(createVerifierPass());
1125-
PerformThinLTO = false;
1126-
}
1127-
1128-
void PassManagerBuilder::populateLTOPassManager(legacy::PassManagerBase &PM) {
1129-
if (LibraryInfo)
1130-
PM.add(new TargetLibraryInfoWrapperPass(*LibraryInfo));
1131-
1132-
if (VerifyInput)
1133-
PM.add(createVerifierPass());
1134-
1135-
addExtensionsToPM(EP_FullLinkTimeOptimizationEarly, PM);
1136-
1137-
if (OptLevel != 0)
1138-
addLTOOptimizationPasses(PM);
1139-
else {
1140-
// The whole-program-devirt pass needs to run at -O0 because only it knows
1141-
// about the llvm.type.checked.load intrinsic: it needs to both lower the
1142-
// intrinsic itself and handle it in the summary.
1143-
PM.add(createWholeProgramDevirtPass(ExportSummary, nullptr));
1144-
}
1145-
1146-
// Create a function that performs CFI checks for cross-DSO calls with targets
1147-
// in the current module.
1148-
PM.add(createCrossDSOCFIPass());
1149-
1150-
// Lower type metadata and the type.test intrinsic. This pass supports Clang's
1151-
// control flow integrity mechanisms (-fsanitize=cfi*) and needs to run at
1152-
// link time if CFI is enabled. The pass does nothing if CFI is disabled.
1153-
PM.add(createLowerTypeTestsPass(ExportSummary, nullptr));
1154-
// Run a second time to clean up any type tests left behind by WPD for use
1155-
// in ICP (which is performed earlier than this in the regular LTO pipeline).
1156-
PM.add(createLowerTypeTestsPass(nullptr, nullptr, true));
1157-
1158-
if (OptLevel != 0)
1159-
addLateLTOOptimizationPasses(PM);
1160-
1161-
addExtensionsToPM(EP_FullLinkTimeOptimizationLast, PM);
1162-
1163-
PM.add(createAnnotationRemarksLegacyPass());
1164-
1165-
if (VerifyOutput)
1166-
PM.add(createVerifierPass());
1167-
}
1168-
11691095
LLVMPassManagerBuilderRef LLVMPassManagerBuilderCreate() {
11701096
PassManagerBuilder *PMB = new PassManagerBuilder();
11711097
return wrap(PMB);
@@ -1231,18 +1157,3 @@ LLVMPassManagerBuilderPopulateModulePassManager(LLVMPassManagerBuilderRef PMB,
12311157
legacy::PassManagerBase *MPM = unwrap(PM);
12321158
Builder->populateModulePassManager(*MPM);
12331159
}
1234-
1235-
void LLVMPassManagerBuilderPopulateLTOPassManager(LLVMPassManagerBuilderRef PMB,
1236-
LLVMPassManagerRef PM,
1237-
LLVMBool Internalize,
1238-
LLVMBool RunInliner) {
1239-
PassManagerBuilder *Builder = unwrap(PMB);
1240-
legacy::PassManagerBase *LPM = unwrap(PM);
1241-
1242-
// A small backwards compatibility hack. populateLTOPassManager used to take
1243-
// an RunInliner option.
1244-
if (RunInliner && !Builder->Inliner)
1245-
Builder->Inliner = createFunctionInliningPass();
1246-
1247-
Builder->populateLTOPassManager(*LPM);
1248-
}

llvm/tools/bugpoint/bugpoint.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,6 @@ static cl::opt<bool>
6767
static cl::list<const PassInfo *, bool, PassNameParser>
6868
PassList(cl::desc("Passes available:"), cl::ZeroOrMore);
6969

70-
static cl::opt<bool>
71-
StandardLinkOpts("std-link-opts",
72-
cl::desc("Include the standard link time optimizations"));
73-
7470
static cl::opt<bool>
7571
OptLevelO1("O1", cl::desc("Optimization level 1. Identical to 'opt -O1'"));
7672

@@ -203,12 +199,6 @@ int main(int argc, char **argv) {
203199

204200
AddToDriver PM(D);
205201

206-
if (StandardLinkOpts) {
207-
PassManagerBuilder Builder;
208-
Builder.Inliner = createFunctionInliningPass();
209-
Builder.populateLTOPassManager(PM);
210-
}
211-
212202
if (OptLevelO1)
213203
AddOptimizationPasses(PM, 1, 0);
214204
else if (OptLevelO2)

0 commit comments

Comments
 (0)