@@ -856,8 +856,7 @@ void PassBuilder::addPGOInstrPasses(ModulePassManager &MPM,
856856 OptimizationLevel Level, bool RunProfileGen,
857857 bool IsCS, bool AtomicCounterUpdate,
858858 std::string ProfileFile,
859- std::string ProfileRemappingFile,
860- IntrusiveRefCntPtr<vfs::FileSystem> FS) {
859+ std::string ProfileRemappingFile) {
861860 assert (Level != OptimizationLevel::O0 && " Not expecting O0 here!" );
862861
863862 if (!RunProfileGen) {
@@ -892,10 +891,11 @@ void PassBuilder::addPGOInstrPasses(ModulePassManager &MPM,
892891 MPM.addPass (InstrProfilingLoweringPass (Options, IsCS));
893892}
894893
895- void PassBuilder::addPGOInstrPassesForO0 (
896- ModulePassManager &MPM, bool RunProfileGen, bool IsCS,
897- bool AtomicCounterUpdate, std::string ProfileFile,
898- std::string ProfileRemappingFile, IntrusiveRefCntPtr<vfs::FileSystem> FS) {
894+ void PassBuilder::addPGOInstrPassesForO0 (ModulePassManager &MPM,
895+ bool RunProfileGen, bool IsCS,
896+ bool AtomicCounterUpdate,
897+ std::string ProfileFile,
898+ std::string ProfileRemappingFile) {
899899 if (!RunProfileGen) {
900900 assert (!ProfileFile.empty () && " Profile use expecting a profile file!" );
901901 MPM.addPass (
@@ -1141,8 +1141,8 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
11411141 if (LoadSampleProfile) {
11421142 // Annotate sample profile right after early FPM to ensure freshness of
11431143 // the debug info.
1144- MPM.addPass (SampleProfileLoaderPass (PGOOpt-> ProfileFile ,
1145- PGOOpt->ProfileRemappingFile , Phase));
1144+ MPM.addPass (SampleProfileLoaderPass (
1145+ PGOOpt-> ProfileFile , PGOOpt->ProfileRemappingFile , Phase, FS ));
11461146 // Cache ProfileSummaryAnalysis once to avoid the potential need to insert
11471147 // RequireAnalysisPass for PSI before subsequent non-module passes.
11481148 MPM.addPass (RequireAnalysisPass<ProfileSummaryAnalysis, Module>());
@@ -1238,8 +1238,7 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
12381238 addPGOInstrPasses (MPM, Level,
12391239 /* RunProfileGen=*/ IsPGOInstrGen,
12401240 /* IsCS=*/ false , PGOOpt->AtomicCounterUpdate ,
1241- PGOOpt->ProfileFile , PGOOpt->ProfileRemappingFile ,
1242- PGOOpt->FS );
1241+ PGOOpt->ProfileFile , PGOOpt->ProfileRemappingFile );
12431242 } else if (IsCtxProfGen || IsCtxProfUse) {
12441243 MPM.addPass (PGOInstrumentationGen (PGOInstrumentationType::CTXPROF));
12451244 // In pre-link, we just want the instrumented IR. We use the contextual
@@ -1262,10 +1261,10 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
12621261 addPostPGOLoopRotation (MPM, Level);
12631262 MPM.addPass (PGOCtxProfLoweringPass ());
12641263 } else if (IsColdFuncOnlyInstrGen) {
1265- addPGOInstrPasses (
1266- MPM, Level, /* RunProfileGen */ true , /* IsCS */ false ,
1267- /* AtomicCounterUpdate */ false , InstrumentColdFuncOnlyPath,
1268- /* ProfileRemappingFile */ " " , IntrusiveRefCntPtr<vfs::FileSystem>() );
1264+ addPGOInstrPasses (MPM, Level, /* RunProfileGen */ true , /* IsCS */ false ,
1265+ /* AtomicCounterUpdate */ false ,
1266+ InstrumentColdFuncOnlyPath,
1267+ /* ProfileRemappingFile */ " " );
12691268 }
12701269
12711270 if (IsPGOInstrGen || IsPGOInstrUse || IsCtxProfGen)
@@ -1276,7 +1275,7 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
12761275 EnableSampledInstr));
12771276
12781277 if (IsMemprofUse)
1279- MPM.addPass (MemProfUsePass (PGOOpt->MemoryProfile , PGOOpt-> FS ));
1278+ MPM.addPass (MemProfUsePass (PGOOpt->MemoryProfile , FS));
12801279
12811280 if (PGOOpt && (PGOOpt->Action == PGOOptions::IRUse ||
12821281 PGOOpt->Action == PGOOptions::SampleUse))
@@ -1485,13 +1484,11 @@ PassBuilder::buildModuleOptimizationPipeline(OptimizationLevel Level,
14851484 if (PGOOpt->CSAction == PGOOptions::CSIRInstr)
14861485 addPGOInstrPasses (MPM, Level, /* RunProfileGen=*/ true ,
14871486 /* IsCS=*/ true , PGOOpt->AtomicCounterUpdate ,
1488- PGOOpt->CSProfileGenFile , PGOOpt->ProfileRemappingFile ,
1489- PGOOpt->FS );
1487+ PGOOpt->CSProfileGenFile , PGOOpt->ProfileRemappingFile );
14901488 else if (PGOOpt->CSAction == PGOOptions::CSIRUse)
14911489 addPGOInstrPasses (MPM, Level, /* RunProfileGen=*/ false ,
14921490 /* IsCS=*/ true , PGOOpt->AtomicCounterUpdate ,
1493- PGOOpt->ProfileFile , PGOOpt->ProfileRemappingFile ,
1494- PGOOpt->FS );
1491+ PGOOpt->ProfileFile , PGOOpt->ProfileRemappingFile );
14951492 }
14961493
14971494 // Re-compute GlobalsAA here prior to function passes. This is particularly
@@ -2091,13 +2088,11 @@ PassBuilder::buildLTODefaultPipeline(OptimizationLevel Level,
20912088 if (PGOOpt->CSAction == PGOOptions::CSIRInstr)
20922089 addPGOInstrPasses (MPM, Level, /* RunProfileGen=*/ true ,
20932090 /* IsCS=*/ true , PGOOpt->AtomicCounterUpdate ,
2094- PGOOpt->CSProfileGenFile , PGOOpt->ProfileRemappingFile ,
2095- PGOOpt->FS );
2091+ PGOOpt->CSProfileGenFile , PGOOpt->ProfileRemappingFile );
20962092 else if (PGOOpt->CSAction == PGOOptions::CSIRUse)
20972093 addPGOInstrPasses (MPM, Level, /* RunProfileGen=*/ false ,
20982094 /* IsCS=*/ true , PGOOpt->AtomicCounterUpdate ,
2099- PGOOpt->ProfileFile , PGOOpt->ProfileRemappingFile ,
2100- PGOOpt->FS );
2095+ PGOOpt->ProfileFile , PGOOpt->ProfileRemappingFile );
21012096 }
21022097
21032098 // Break up allocas
@@ -2259,7 +2254,7 @@ PassBuilder::buildO0DefaultPipeline(OptimizationLevel Level,
22592254 MPM,
22602255 /* RunProfileGen=*/ (PGOOpt->Action == PGOOptions::IRInstr),
22612256 /* IsCS=*/ false , PGOOpt->AtomicCounterUpdate , PGOOpt->ProfileFile ,
2262- PGOOpt->ProfileRemappingFile , PGOOpt-> FS );
2257+ PGOOpt->ProfileRemappingFile );
22632258
22642259 // Instrument function entry and exit before all inlining.
22652260 MPM.addPass (createModuleToFunctionPassAdaptor (
0 commit comments