@@ -848,8 +848,7 @@ void PassBuilder::addPGOInstrPasses(ModulePassManager &MPM,
848
848
OptimizationLevel Level, bool RunProfileGen,
849
849
bool IsCS, bool AtomicCounterUpdate,
850
850
std::string ProfileFile,
851
- std::string ProfileRemappingFile,
852
- IntrusiveRefCntPtr<vfs::FileSystem> FS) {
851
+ std::string ProfileRemappingFile) {
853
852
assert (Level != OptimizationLevel::O0 && " Not expecting O0 here!" );
854
853
855
854
if (!RunProfileGen) {
@@ -884,10 +883,11 @@ void PassBuilder::addPGOInstrPasses(ModulePassManager &MPM,
884
883
MPM.addPass (InstrProfilingLoweringPass (Options, IsCS));
885
884
}
886
885
887
- void PassBuilder::addPGOInstrPassesForO0 (
888
- ModulePassManager &MPM, bool RunProfileGen, bool IsCS,
889
- bool AtomicCounterUpdate, std::string ProfileFile,
890
- std::string ProfileRemappingFile, IntrusiveRefCntPtr<vfs::FileSystem> FS) {
886
+ void PassBuilder::addPGOInstrPassesForO0 (ModulePassManager &MPM,
887
+ bool RunProfileGen, bool IsCS,
888
+ bool AtomicCounterUpdate,
889
+ std::string ProfileFile,
890
+ std::string ProfileRemappingFile) {
891
891
if (!RunProfileGen) {
892
892
assert (!ProfileFile.empty () && " Profile use expecting a profile file!" );
893
893
MPM.addPass (
@@ -1133,8 +1133,8 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
1133
1133
if (LoadSampleProfile) {
1134
1134
// Annotate sample profile right after early FPM to ensure freshness of
1135
1135
// the debug info.
1136
- MPM.addPass (SampleProfileLoaderPass (PGOOpt-> ProfileFile ,
1137
- PGOOpt->ProfileRemappingFile , Phase));
1136
+ MPM.addPass (SampleProfileLoaderPass (
1137
+ PGOOpt-> ProfileFile , PGOOpt->ProfileRemappingFile , Phase, FS ));
1138
1138
// Cache ProfileSummaryAnalysis once to avoid the potential need to insert
1139
1139
// RequireAnalysisPass for PSI before subsequent non-module passes.
1140
1140
MPM.addPass (RequireAnalysisPass<ProfileSummaryAnalysis, Module>());
@@ -1230,8 +1230,7 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
1230
1230
addPGOInstrPasses (MPM, Level,
1231
1231
/* RunProfileGen=*/ IsPGOInstrGen,
1232
1232
/* IsCS=*/ false , PGOOpt->AtomicCounterUpdate ,
1233
- PGOOpt->ProfileFile , PGOOpt->ProfileRemappingFile ,
1234
- PGOOpt->FS );
1233
+ PGOOpt->ProfileFile , PGOOpt->ProfileRemappingFile );
1235
1234
} else if (IsCtxProfGen || IsCtxProfUse) {
1236
1235
MPM.addPass (PGOInstrumentationGen (PGOInstrumentationType::CTXPROF));
1237
1236
// In pre-link, we just want the instrumented IR. We use the contextual
@@ -1254,10 +1253,10 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
1254
1253
addPostPGOLoopRotation (MPM, Level);
1255
1254
MPM.addPass (PGOCtxProfLoweringPass ());
1256
1255
} else if (IsColdFuncOnlyInstrGen) {
1257
- addPGOInstrPasses (
1258
- MPM, Level, /* RunProfileGen */ true , /* IsCS */ false ,
1259
- /* AtomicCounterUpdate */ false , InstrumentColdFuncOnlyPath,
1260
- /* ProfileRemappingFile */ " " , IntrusiveRefCntPtr<vfs::FileSystem>() );
1256
+ addPGOInstrPasses (MPM, Level, /* RunProfileGen */ true , /* IsCS */ false ,
1257
+ /* AtomicCounterUpdate */ false ,
1258
+ InstrumentColdFuncOnlyPath,
1259
+ /* ProfileRemappingFile */ " " );
1261
1260
}
1262
1261
1263
1262
if (IsPGOInstrGen || IsPGOInstrUse || IsCtxProfGen)
@@ -1268,7 +1267,7 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
1268
1267
EnableSampledInstr));
1269
1268
1270
1269
if (IsMemprofUse)
1271
- MPM.addPass (MemProfUsePass (PGOOpt->MemoryProfile , PGOOpt-> FS ));
1270
+ MPM.addPass (MemProfUsePass (PGOOpt->MemoryProfile , FS));
1272
1271
1273
1272
if (PGOOpt && (PGOOpt->Action == PGOOptions::IRUse ||
1274
1273
PGOOpt->Action == PGOOptions::SampleUse))
@@ -1477,13 +1476,11 @@ PassBuilder::buildModuleOptimizationPipeline(OptimizationLevel Level,
1477
1476
if (PGOOpt->CSAction == PGOOptions::CSIRInstr)
1478
1477
addPGOInstrPasses (MPM, Level, /* RunProfileGen=*/ true ,
1479
1478
/* IsCS=*/ true , PGOOpt->AtomicCounterUpdate ,
1480
- PGOOpt->CSProfileGenFile , PGOOpt->ProfileRemappingFile ,
1481
- PGOOpt->FS );
1479
+ PGOOpt->CSProfileGenFile , PGOOpt->ProfileRemappingFile );
1482
1480
else if (PGOOpt->CSAction == PGOOptions::CSIRUse)
1483
1481
addPGOInstrPasses (MPM, Level, /* RunProfileGen=*/ false ,
1484
1482
/* IsCS=*/ true , PGOOpt->AtomicCounterUpdate ,
1485
- PGOOpt->ProfileFile , PGOOpt->ProfileRemappingFile ,
1486
- PGOOpt->FS );
1483
+ PGOOpt->ProfileFile , PGOOpt->ProfileRemappingFile );
1487
1484
}
1488
1485
1489
1486
// Re-compute GlobalsAA here prior to function passes. This is particularly
@@ -2070,13 +2067,11 @@ PassBuilder::buildLTODefaultPipeline(OptimizationLevel Level,
2070
2067
if (PGOOpt->CSAction == PGOOptions::CSIRInstr)
2071
2068
addPGOInstrPasses (MPM, Level, /* RunProfileGen=*/ true ,
2072
2069
/* IsCS=*/ true , PGOOpt->AtomicCounterUpdate ,
2073
- PGOOpt->CSProfileGenFile , PGOOpt->ProfileRemappingFile ,
2074
- PGOOpt->FS );
2070
+ PGOOpt->CSProfileGenFile , PGOOpt->ProfileRemappingFile );
2075
2071
else if (PGOOpt->CSAction == PGOOptions::CSIRUse)
2076
2072
addPGOInstrPasses (MPM, Level, /* RunProfileGen=*/ false ,
2077
2073
/* IsCS=*/ true , PGOOpt->AtomicCounterUpdate ,
2078
- PGOOpt->ProfileFile , PGOOpt->ProfileRemappingFile ,
2079
- PGOOpt->FS );
2074
+ PGOOpt->ProfileFile , PGOOpt->ProfileRemappingFile );
2080
2075
}
2081
2076
2082
2077
// Break up allocas
@@ -2236,7 +2231,7 @@ PassBuilder::buildO0DefaultPipeline(OptimizationLevel Level,
2236
2231
MPM,
2237
2232
/* RunProfileGen=*/ (PGOOpt->Action == PGOOptions::IRInstr),
2238
2233
/* IsCS=*/ false , PGOOpt->AtomicCounterUpdate , PGOOpt->ProfileFile ,
2239
- PGOOpt->ProfileRemappingFile , PGOOpt-> FS );
2234
+ PGOOpt->ProfileRemappingFile );
2240
2235
2241
2236
// Instrument function entry and exit before all inlining.
2242
2237
MPM.addPass (createModuleToFunctionPassAdaptor (
0 commit comments