@@ -1025,7 +1025,7 @@ static void addPreloadKernArgHint(Function &F, TargetMachine &TM) {
10251025}
10261026
10271027static bool runImpl (Module &M, AnalysisGetter &AG, TargetMachine &TM,
1028- bool HasWholeProgramVisibility ) {
1028+ AMDGPUAttributorOptions Options ) {
10291029 SetVector<Function *> Functions;
10301030 for (Function &F : M) {
10311031 if (!F.isIntrinsic ())
@@ -1043,7 +1043,7 @@ static bool runImpl(Module &M, AnalysisGetter &AG, TargetMachine &TM,
10431043 &AAUnderlyingObjects::ID, &AAIndirectCallInfo::ID, &AAInstanceInfo::ID});
10441044
10451045 AttributorConfig AC (CGUpdater);
1046- AC.IsClosedWorldModule = HasWholeProgramVisibility ;
1046+ AC.IsClosedWorldModule = Options. IsClosedWorld ;
10471047 AC.Allowed = &Allowed;
10481048 AC.IsModulePass = true ;
10491049 AC.DefaultInitializeLiveInternals = false ;
@@ -1102,7 +1102,7 @@ class AMDGPUAttributorLegacy : public ModulePass {
11021102
11031103 bool runOnModule (Module &M) override {
11041104 AnalysisGetter AG (this );
1105- return runImpl (M, AG, *TM, /* HasWholeProgramVisibility =*/ false );
1105+ return runImpl (M, AG, *TM, /* Options =*/ {} );
11061106 }
11071107
11081108 void getAnalysisUsage (AnalysisUsage &AU) const override {
@@ -1123,9 +1123,8 @@ PreservedAnalyses llvm::AMDGPUAttributorPass::run(Module &M,
11231123 AnalysisGetter AG (FAM);
11241124
11251125 // TODO: Probably preserves CFG
1126- return runImpl (M, AG, TM, HasWholeProgramVisibility)
1127- ? PreservedAnalyses::none ()
1128- : PreservedAnalyses::all ();
1126+ return runImpl (M, AG, TM, Options) ? PreservedAnalyses::none ()
1127+ : PreservedAnalyses::all ();
11291128}
11301129
11311130char AMDGPUAttributorLegacy::ID = 0 ;
0 commit comments