@@ -1092,80 +1092,6 @@ void PassManagerBuilder::addLateLTOOptimizationPasses(
1092
1092
PM.add (createMergeFunctionsPass ());
1093
1093
}
1094
1094
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
-
1169
1095
LLVMPassManagerBuilderRef LLVMPassManagerBuilderCreate () {
1170
1096
PassManagerBuilder *PMB = new PassManagerBuilder ();
1171
1097
return wrap (PMB);
@@ -1231,18 +1157,3 @@ LLVMPassManagerBuilderPopulateModulePassManager(LLVMPassManagerBuilderRef PMB,
1231
1157
legacy::PassManagerBase *MPM = unwrap (PM);
1232
1158
Builder->populateModulePassManager (*MPM);
1233
1159
}
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
- }
0 commit comments