Skip to content

Commit a5569b4

Browse files
authored
[llvm] Add vfs::FileSystem to PassBuilder (#160188)
Some LLVM passes need access to the filesystem to read configuration files and similar. In some places, this is achieved by grabbing the VFS from `PGOOptions`, but some passes don't have access to these and resort to just calling `vfs::getRealFileSystem()`. This PR allows setting the VFS directly on `PassBuilder` that's able to pass it down to all passes that need it.
1 parent 35c14c4 commit a5569b4

File tree

12 files changed

+81
-98
lines changed

12 files changed

+81
-98
lines changed

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,8 @@ static void addSanitizers(const Triple &TargetTriple,
785785
HWASanPass(SanitizerKind::KernelHWAddress, true);
786786

787787
if (LangOpts.Sanitize.has(SanitizerKind::DataFlow)) {
788-
MPM.addPass(DataFlowSanitizerPass(LangOpts.NoSanitizeFiles));
788+
MPM.addPass(DataFlowSanitizerPass(LangOpts.NoSanitizeFiles,
789+
PB.getVirtualFileSystemPtr()));
789790
}
790791
};
791792
if (ClSanitizeOnOptimizerEarlyEP) {
@@ -837,9 +838,9 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
837838
if (CodeGenOpts.hasProfileIRInstr())
838839
// -fprofile-generate.
839840
PGOOpt = PGOOptions(getProfileGenName(CodeGenOpts), "", "",
840-
CodeGenOpts.MemoryProfileUsePath, nullptr,
841-
PGOOptions::IRInstr, PGOOptions::NoCSAction,
842-
ClPGOColdFuncAttr, CodeGenOpts.DebugInfoForProfiling,
841+
CodeGenOpts.MemoryProfileUsePath, PGOOptions::IRInstr,
842+
PGOOptions::NoCSAction, ClPGOColdFuncAttr,
843+
CodeGenOpts.DebugInfoForProfiling,
843844
/*PseudoProbeForProfiling=*/false,
844845
CodeGenOpts.AtomicProfileUpdate);
845846
else if (CodeGenOpts.hasProfileIRUse()) {
@@ -848,32 +849,30 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
848849
: PGOOptions::NoCSAction;
849850
PGOOpt = PGOOptions(CodeGenOpts.ProfileInstrumentUsePath, "",
850851
CodeGenOpts.ProfileRemappingFile,
851-
CodeGenOpts.MemoryProfileUsePath, VFS,
852-
PGOOptions::IRUse, CSAction, ClPGOColdFuncAttr,
852+
CodeGenOpts.MemoryProfileUsePath, PGOOptions::IRUse,
853+
CSAction, ClPGOColdFuncAttr,
853854
CodeGenOpts.DebugInfoForProfiling);
854855
} else if (!CodeGenOpts.SampleProfileFile.empty())
855856
// -fprofile-sample-use
856857
PGOOpt = PGOOptions(
857858
CodeGenOpts.SampleProfileFile, "", CodeGenOpts.ProfileRemappingFile,
858-
CodeGenOpts.MemoryProfileUsePath, VFS, PGOOptions::SampleUse,
859+
CodeGenOpts.MemoryProfileUsePath, PGOOptions::SampleUse,
859860
PGOOptions::NoCSAction, ClPGOColdFuncAttr,
860861
CodeGenOpts.DebugInfoForProfiling, CodeGenOpts.PseudoProbeForProfiling);
861862
else if (!CodeGenOpts.MemoryProfileUsePath.empty())
862863
// -fmemory-profile-use (without any of the above options)
863-
PGOOpt = PGOOptions("", "", "", CodeGenOpts.MemoryProfileUsePath, VFS,
864+
PGOOpt = PGOOptions("", "", "", CodeGenOpts.MemoryProfileUsePath,
864865
PGOOptions::NoAction, PGOOptions::NoCSAction,
865866
ClPGOColdFuncAttr, CodeGenOpts.DebugInfoForProfiling);
866867
else if (CodeGenOpts.PseudoProbeForProfiling)
867868
// -fpseudo-probe-for-profiling
868-
PGOOpt =
869-
PGOOptions("", "", "", /*MemoryProfile=*/"", nullptr,
870-
PGOOptions::NoAction, PGOOptions::NoCSAction,
871-
ClPGOColdFuncAttr, CodeGenOpts.DebugInfoForProfiling, true);
869+
PGOOpt = PGOOptions("", "", "", /*MemoryProfile=*/"", PGOOptions::NoAction,
870+
PGOOptions::NoCSAction, ClPGOColdFuncAttr,
871+
CodeGenOpts.DebugInfoForProfiling, true);
872872
else if (CodeGenOpts.DebugInfoForProfiling)
873873
// -fdebug-info-for-profiling
874-
PGOOpt = PGOOptions("", "", "", /*MemoryProfile=*/"", nullptr,
875-
PGOOptions::NoAction, PGOOptions::NoCSAction,
876-
ClPGOColdFuncAttr, true);
874+
PGOOpt = PGOOptions("", "", "", /*MemoryProfile=*/"", PGOOptions::NoAction,
875+
PGOOptions::NoCSAction, ClPGOColdFuncAttr, true);
877876

878877
// Check to see if we want to generate a CS profile.
879878
if (CodeGenOpts.hasProfileCSIRInstr()) {
@@ -889,7 +888,7 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
889888
PGOOpt->CSAction = PGOOptions::CSIRInstr;
890889
} else
891890
PGOOpt = PGOOptions("", getProfileGenName(CodeGenOpts), "",
892-
/*MemoryProfile=*/"", nullptr, PGOOptions::NoAction,
891+
/*MemoryProfile=*/"", PGOOptions::NoAction,
893892
PGOOptions::CSIRInstr, ClPGOColdFuncAttr,
894893
CodeGenOpts.DebugInfoForProfiling);
895894
}
@@ -926,7 +925,7 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
926925
(CodeGenOpts.DebugPassManager || DebugPassStructure),
927926
CodeGenOpts.VerifyEach, PrintPassOpts);
928927
SI.registerCallbacks(PIC, &MAM);
929-
PassBuilder PB(TM.get(), PTO, PGOOpt, &PIC);
928+
PassBuilder PB(TM.get(), PTO, PGOOpt, &PIC, CI.getVirtualFileSystemPtr());
930929

931930
// Handle the assignment tracking feature options.
932931
switch (CodeGenOpts.getAssignmentTrackingMode()) {

flang/lib/Frontend/FrontendActions.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -936,20 +936,18 @@ void CodeGenAction::runOptimizationPipeline(llvm::raw_pwrite_stream &os) {
936936
pgoOpt = llvm::PGOOptions(opts.InstrProfileOutput.empty()
937937
? llvm::driver::getDefaultProfileGenName()
938938
: opts.InstrProfileOutput,
939-
"", "", opts.MemoryProfileUsePath, nullptr,
939+
"", "", opts.MemoryProfileUsePath,
940940
llvm::PGOOptions::IRInstr,
941941
llvm::PGOOptions::NoCSAction,
942942
llvm::PGOOptions::ColdFuncOpt::Default, false,
943943
/*PseudoProbeForProfiling=*/false, false);
944944
} else if (opts.hasProfileIRUse()) {
945-
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS =
946-
llvm::vfs::getRealFileSystem();
947945
// -fprofile-use.
948946
auto CSAction = opts.hasProfileCSIRUse() ? llvm::PGOOptions::CSIRUse
949947
: llvm::PGOOptions::NoCSAction;
950948
pgoOpt = llvm::PGOOptions(
951949
opts.ProfileInstrumentUsePath, "", opts.ProfileRemappingFile,
952-
opts.MemoryProfileUsePath, VFS, llvm::PGOOptions::IRUse, CSAction,
950+
opts.MemoryProfileUsePath, llvm::PGOOptions::IRUse, CSAction,
953951
llvm::PGOOptions::ColdFuncOpt::Default, false);
954952
}
955953

llvm/include/llvm/Passes/PassBuilder.h

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "llvm/Support/Compiler.h"
2424
#include "llvm/Support/Error.h"
2525
#include "llvm/Support/PGOOptions.h"
26+
#include "llvm/Support/VirtualFileSystem.h"
2627
#include "llvm/Support/raw_ostream.h"
2728
#include "llvm/Transforms/IPO/Inliner.h"
2829
#include "llvm/Transforms/IPO/ModuleInliner.h"
@@ -35,10 +36,6 @@ class StringRef;
3536
class AAManager;
3637
class TargetMachine;
3738
class ModuleSummaryIndex;
38-
template <typename T> class IntrusiveRefCntPtr;
39-
namespace vfs {
40-
class FileSystem;
41-
} // namespace vfs
4239

4340
/// Tunable parameters for passes in the default pipelines.
4441
class PipelineTuningOptions {
@@ -115,6 +112,7 @@ class PassBuilder {
115112
PipelineTuningOptions PTO;
116113
std::optional<PGOOptions> PGOOpt;
117114
PassInstrumentationCallbacks *PIC;
115+
IntrusiveRefCntPtr<vfs::FileSystem> FS;
118116

119117
public:
120118
/// A struct to capture parsed pass pipeline names.
@@ -134,7 +132,8 @@ class PassBuilder {
134132
TargetMachine *TM = nullptr,
135133
PipelineTuningOptions PTO = PipelineTuningOptions(),
136134
std::optional<PGOOptions> PGOOpt = std::nullopt,
137-
PassInstrumentationCallbacks *PIC = nullptr);
135+
PassInstrumentationCallbacks *PIC = nullptr,
136+
IntrusiveRefCntPtr<vfs::FileSystem> FS = vfs::getRealFileSystem());
138137

139138
/// Cross register the analysis managers through their proxies.
140139
///
@@ -632,15 +631,19 @@ class PassBuilder {
632631
bool RunProfileGen, bool IsCS,
633632
bool AtomicCounterUpdate,
634633
std::string ProfileFile,
635-
std::string ProfileRemappingFile,
636-
IntrusiveRefCntPtr<vfs::FileSystem> FS);
634+
std::string ProfileRemappingFile);
637635

638636
/// Returns PIC. External libraries can use this to register pass
639637
/// instrumentation callbacks.
640638
PassInstrumentationCallbacks *getPassInstrumentationCallbacks() const {
641639
return PIC;
642640
}
643641

642+
/// Returns the virtual file system.
643+
IntrusiveRefCntPtr<vfs::FileSystem> getVirtualFileSystemPtr() const {
644+
return FS;
645+
}
646+
644647
// Invoke the callbacks registered for the various extension points.
645648
// Custom pipelines should use these to invoke the callbacks registered
646649
// by TargetMachines and other clients.
@@ -772,8 +775,7 @@ class PassBuilder {
772775
void addPGOInstrPasses(ModulePassManager &MPM, OptimizationLevel Level,
773776
bool RunProfileGen, bool IsCS,
774777
bool AtomicCounterUpdate, std::string ProfileFile,
775-
std::string ProfileRemappingFile,
776-
IntrusiveRefCntPtr<vfs::FileSystem> FS);
778+
std::string ProfileRemappingFile);
777779
void addPostPGOLoopRotation(ModulePassManager &MPM, OptimizationLevel Level);
778780

779781
bool isInstrumentedPGOUse() const;

llvm/include/llvm/Support/PGOOptions.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,18 @@
1414
#ifndef LLVM_SUPPORT_PGOOPTIONS_H
1515
#define LLVM_SUPPORT_PGOOPTIONS_H
1616

17-
#include "llvm/ADT/IntrusiveRefCntPtr.h"
1817
#include "llvm/Support/Compiler.h"
1918
#include "llvm/Support/Error.h"
2019

2120
namespace llvm {
22-
23-
namespace vfs {
24-
class FileSystem;
25-
} // namespace vfs
26-
2721
/// A struct capturing PGO tunables.
2822
struct PGOOptions {
2923
enum PGOAction { NoAction, IRInstr, IRUse, SampleUse };
3024
enum CSPGOAction { NoCSAction, CSIRInstr, CSIRUse };
3125
enum class ColdFuncOpt { Default, OptSize, MinSize, OptNone };
3226
LLVM_ABI PGOOptions(std::string ProfileFile, std::string CSProfileGenFile,
3327
std::string ProfileRemappingFile,
34-
std::string MemoryProfile,
35-
IntrusiveRefCntPtr<vfs::FileSystem> FS,
36-
PGOAction Action = NoAction,
28+
std::string MemoryProfile, PGOAction Action = NoAction,
3729
CSPGOAction CSAction = NoCSAction,
3830
ColdFuncOpt ColdType = ColdFuncOpt::Default,
3931
bool DebugInfoForProfiling = false,
@@ -53,7 +45,6 @@ struct PGOOptions {
5345
bool DebugInfoForProfiling;
5446
bool PseudoProbeForProfiling;
5547
bool AtomicCounterUpdate;
56-
IntrusiveRefCntPtr<vfs::FileSystem> FS;
5748
};
5849
} // namespace llvm
5950

llvm/include/llvm/Transforms/Instrumentation/DataFlowSanitizer.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#include "llvm/IR/PassManager.h"
1212
#include "llvm/Support/Compiler.h"
13+
#include "llvm/Support/VirtualFileSystem.h"
1314
#include <string>
1415
#include <vector>
1516

@@ -19,11 +20,13 @@ class Module;
1920
class DataFlowSanitizerPass : public PassInfoMixin<DataFlowSanitizerPass> {
2021
private:
2122
std::vector<std::string> ABIListFiles;
23+
IntrusiveRefCntPtr<vfs::FileSystem> FS;
2224

2325
public:
2426
DataFlowSanitizerPass(
25-
const std::vector<std::string> &ABIListFiles = std::vector<std::string>())
26-
: ABIListFiles(ABIListFiles) {}
27+
const std::vector<std::string> &ABIListFiles = std::vector<std::string>(),
28+
IntrusiveRefCntPtr<vfs::FileSystem> FS = vfs::getRealFileSystem())
29+
: ABIListFiles(ABIListFiles), FS(std::move(FS)) {}
2730
LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
2831
static bool isRequired() { return true; }
2932
};

llvm/lib/LTO/LTOBackend.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -240,27 +240,26 @@ static void runNewPMPasses(const Config &Conf, Module &Mod, TargetMachine *TM,
240240
unsigned OptLevel, bool IsThinLTO,
241241
ModuleSummaryIndex *ExportSummary,
242242
const ModuleSummaryIndex *ImportSummary) {
243-
auto FS = vfs::getRealFileSystem();
244243
std::optional<PGOOptions> PGOOpt;
245244
if (!Conf.SampleProfile.empty())
246245
PGOOpt = PGOOptions(Conf.SampleProfile, "", Conf.ProfileRemapping,
247-
/*MemoryProfile=*/"", FS, PGOOptions::SampleUse,
246+
/*MemoryProfile=*/"", PGOOptions::SampleUse,
248247
PGOOptions::NoCSAction,
249248
PGOOptions::ColdFuncOpt::Default, true);
250249
else if (Conf.RunCSIRInstr) {
251250
PGOOpt = PGOOptions("", Conf.CSIRProfile, Conf.ProfileRemapping,
252-
/*MemoryProfile=*/"", FS, PGOOptions::IRUse,
251+
/*MemoryProfile=*/"", PGOOptions::IRUse,
253252
PGOOptions::CSIRInstr, PGOOptions::ColdFuncOpt::Default,
254253
Conf.AddFSDiscriminator);
255254
} else if (!Conf.CSIRProfile.empty()) {
256-
PGOOpt = PGOOptions(Conf.CSIRProfile, "", Conf.ProfileRemapping,
257-
/*MemoryProfile=*/"", FS, PGOOptions::IRUse,
258-
PGOOptions::CSIRUse, PGOOptions::ColdFuncOpt::Default,
259-
Conf.AddFSDiscriminator);
255+
PGOOpt =
256+
PGOOptions(Conf.CSIRProfile, "", Conf.ProfileRemapping,
257+
/*MemoryProfile=*/"", PGOOptions::IRUse, PGOOptions::CSIRUse,
258+
PGOOptions::ColdFuncOpt::Default, Conf.AddFSDiscriminator);
260259
NoPGOWarnMismatch = !Conf.PGOWarnMismatch;
261260
} else if (Conf.AddFSDiscriminator) {
262-
PGOOpt = PGOOptions("", "", "", /*MemoryProfile=*/"", nullptr,
263-
PGOOptions::NoAction, PGOOptions::NoCSAction,
261+
PGOOpt = PGOOptions("", "", "", /*MemoryProfile=*/"", PGOOptions::NoAction,
262+
PGOOptions::NoCSAction,
264263
PGOOptions::ColdFuncOpt::Default, true);
265264
}
266265
TM->setPGOOption(PGOOpt);

llvm/lib/Passes/PassBuilder.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,8 +503,9 @@ static Expected<OptimizationLevel> parseOptLevelParam(StringRef S) {
503503

504504
PassBuilder::PassBuilder(TargetMachine *TM, PipelineTuningOptions PTO,
505505
std::optional<PGOOptions> PGOOpt,
506-
PassInstrumentationCallbacks *PIC)
507-
: TM(TM), PTO(PTO), PGOOpt(PGOOpt), PIC(PIC) {
506+
PassInstrumentationCallbacks *PIC,
507+
IntrusiveRefCntPtr<vfs::FileSystem> FS)
508+
: TM(TM), PTO(PTO), PGOOpt(PGOOpt), PIC(PIC), FS(std::move(FS)) {
508509
if (TM)
509510
TM->registerPassBuilderCallbacks(*this);
510511
if (PIC) {

llvm/lib/Passes/PassBuilderPipelines.cpp

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)