[llvm] pr/amdgpu closed world (PR #66488)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 19 00:18:44 PDT 2024
================
@@ -1036,14 +1041,33 @@ static bool runImpl(Module &M, AnalysisGetter &AG, TargetMachine &TM) {
DenseSet<const char *> Allowed(
{&AAAMDAttributes::ID, &AAUniformWorkGroupSize::ID,
&AAPotentialValues::ID, &AAAMDFlatWorkGroupSize::ID,
- &AAAMDWavesPerEU::ID, &AAAMDGPUNoAGPR::ID, &AACallEdges::ID,
- &AAPointerInfo::ID, &AAPotentialConstantValues::ID,
- &AAUnderlyingObjects::ID});
+ &AAAMDWavesPerEU::ID, &AAAMDGPUNoAGPR::ID, &AACallEdges::ID, &AAPointerInfo::ID,
+ &AAPotentialConstantValues::ID, &AAUnderlyingObjects::ID,
+ &AAIndirectCallInfo::ID});
+
+ /// Helper to decide if we should specialize the indirect \p CB for \p Callee,
+ /// which is one of the \p NumCallees potential callees.
+ auto IndirectCalleeSpecializationCallback =
+ [&](Attributor &A, const AbstractAttribute &AA, CallBase &CB,
+ Function &Callee, unsigned NumCallees) {
+ if (AMDGPU::isEntryFunctionCC(Callee.getCallingConv()))
+ return false;
+ // Singleton functions should be specialized.
+ if (NumCallees == 1)
+ return true;
+ // Otherewise specialize uniform values.
+ const auto &TTI = TM.getTargetTransformInfo(*CB.getCaller());
+ return TTI.isAlwaysUniform(CB.getCalledOperand());
+ };
AttributorConfig AC(CGUpdater);
AC.Allowed = &Allowed;
AC.IsModulePass = true;
AC.DefaultInitializeLiveInternals = false;
+ errs() << "HasWholeProgramVisibility " << HasWholeProgramVisibility << "\n";
----------------
arsenm wrote:
Leftover debug printing
https://github.com/llvm/llvm-project/pull/66488
More information about the llvm-commits
mailing list