@@ -848,8 +848,7 @@ void PassBuilder::addPGOInstrPasses(ModulePassManager &MPM,
848848 OptimizationLevel Level, bool RunProfileGen,
849849 bool IsCS, bool AtomicCounterUpdate,
850850 std::string ProfileFile,
851- std::string ProfileRemappingFile,
852- IntrusiveRefCntPtr<vfs::FileSystem> FS) {
851+ std::string ProfileRemappingFile) {
853852 assert (Level != OptimizationLevel::O0 && " Not expecting O0 here!" );
854853
855854 if (!RunProfileGen) {
@@ -884,10 +883,11 @@ void PassBuilder::addPGOInstrPasses(ModulePassManager &MPM,
884883 MPM.addPass (InstrProfilingLoweringPass (Options, IsCS));
885884}
886885
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) {
891891 if (!RunProfileGen) {
892892 assert (!ProfileFile.empty () && " Profile use expecting a profile file!" );
893893 MPM.addPass (
@@ -1133,8 +1133,8 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
11331133 if (LoadSampleProfile) {
11341134 // Annotate sample profile right after early FPM to ensure freshness of
11351135 // the debug info.
1136- MPM.addPass (SampleProfileLoaderPass (PGOOpt-> ProfileFile ,
1137- PGOOpt->ProfileRemappingFile , Phase));
1136+ MPM.addPass (SampleProfileLoaderPass (
1137+ PGOOpt-> ProfileFile , PGOOpt->ProfileRemappingFile , Phase, FS ));
11381138 // Cache ProfileSummaryAnalysis once to avoid the potential need to insert
11391139 // RequireAnalysisPass for PSI before subsequent non-module passes.
11401140 MPM.addPass (RequireAnalysisPass<ProfileSummaryAnalysis, Module>());
@@ -1230,8 +1230,7 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
12301230 addPGOInstrPasses (MPM, Level,
12311231 /* RunProfileGen=*/ IsPGOInstrGen,
12321232 /* IsCS=*/ false , PGOOpt->AtomicCounterUpdate ,
1233- PGOOpt->ProfileFile , PGOOpt->ProfileRemappingFile ,
1234- PGOOpt->FS );
1233+ PGOOpt->ProfileFile , PGOOpt->ProfileRemappingFile );
12351234 } else if (IsCtxProfGen || IsCtxProfUse) {
12361235 MPM.addPass (PGOInstrumentationGen (PGOInstrumentationType::CTXPROF));
12371236 // In pre-link, we just want the instrumented IR. We use the contextual
@@ -1254,10 +1253,10 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
12541253 addPostPGOLoopRotation (MPM, Level);
12551254 MPM.addPass (PGOCtxProfLoweringPass ());
12561255 } 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 */ " " );
12611260 }
12621261
12631262 if (IsPGOInstrGen || IsPGOInstrUse || IsCtxProfGen)
@@ -1268,7 +1267,7 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
12681267 EnableSampledInstr));
12691268
12701269 if (IsMemprofUse)
1271- MPM.addPass (MemProfUsePass (PGOOpt->MemoryProfile , PGOOpt-> FS ));
1270+ MPM.addPass (MemProfUsePass (PGOOpt->MemoryProfile , FS));
12721271
12731272 if (PGOOpt && (PGOOpt->Action == PGOOptions::IRUse ||
12741273 PGOOpt->Action == PGOOptions::SampleUse))
@@ -1477,13 +1476,11 @@ PassBuilder::buildModuleOptimizationPipeline(OptimizationLevel Level,
14771476 if (PGOOpt->CSAction == PGOOptions::CSIRInstr)
14781477 addPGOInstrPasses (MPM, Level, /* RunProfileGen=*/ true ,
14791478 /* IsCS=*/ true , PGOOpt->AtomicCounterUpdate ,
1480- PGOOpt->CSProfileGenFile , PGOOpt->ProfileRemappingFile ,
1481- PGOOpt->FS );
1479+ PGOOpt->CSProfileGenFile , PGOOpt->ProfileRemappingFile );
14821480 else if (PGOOpt->CSAction == PGOOptions::CSIRUse)
14831481 addPGOInstrPasses (MPM, Level, /* RunProfileGen=*/ false ,
14841482 /* IsCS=*/ true , PGOOpt->AtomicCounterUpdate ,
1485- PGOOpt->ProfileFile , PGOOpt->ProfileRemappingFile ,
1486- PGOOpt->FS );
1483+ PGOOpt->ProfileFile , PGOOpt->ProfileRemappingFile );
14871484 }
14881485
14891486 // Re-compute GlobalsAA here prior to function passes. This is particularly
@@ -2071,13 +2068,11 @@ PassBuilder::buildLTODefaultPipeline(OptimizationLevel Level,
20712068 if (PGOOpt->CSAction == PGOOptions::CSIRInstr)
20722069 addPGOInstrPasses (MPM, Level, /* RunProfileGen=*/ true ,
20732070 /* IsCS=*/ true , PGOOpt->AtomicCounterUpdate ,
2074- PGOOpt->CSProfileGenFile , PGOOpt->ProfileRemappingFile ,
2075- PGOOpt->FS );
2071+ PGOOpt->CSProfileGenFile , PGOOpt->ProfileRemappingFile );
20762072 else if (PGOOpt->CSAction == PGOOptions::CSIRUse)
20772073 addPGOInstrPasses (MPM, Level, /* RunProfileGen=*/ false ,
20782074 /* IsCS=*/ true , PGOOpt->AtomicCounterUpdate ,
2079- PGOOpt->ProfileFile , PGOOpt->ProfileRemappingFile ,
2080- PGOOpt->FS );
2075+ PGOOpt->ProfileFile , PGOOpt->ProfileRemappingFile );
20812076 }
20822077
20832078 // Break up allocas
@@ -2237,7 +2232,7 @@ PassBuilder::buildO0DefaultPipeline(OptimizationLevel Level,
22372232 MPM,
22382233 /* RunProfileGen=*/ (PGOOpt->Action == PGOOptions::IRInstr),
22392234 /* IsCS=*/ false , PGOOpt->AtomicCounterUpdate , PGOOpt->ProfileFile ,
2240- PGOOpt->ProfileRemappingFile , PGOOpt-> FS );
2235+ PGOOpt->ProfileRemappingFile );
22412236
22422237 // Instrument function entry and exit before all inlining.
22432238 MPM.addPass (createModuleToFunctionPassAdaptor (
0 commit comments