[llvm-branch-commits] [llvm] [AMDGPU][Attributor] Rework update of `AAAMDWavesPerEU` (PR #123995)
Matt Arsenault via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu May 1 11:30:07 PDT 2025
================
@@ -1108,47 +1108,25 @@ struct AAAMDWavesPerEU : public AAAMDSizeRangeAttribute {
Function *F = getAssociatedFunction();
auto &InfoCache = static_cast<AMDGPUInformationCache &>(A.getInfoCache());
- auto TakeRange = [&](std::pair<unsigned, unsigned> R) {
- auto [Min, Max] = R;
- ConstantRange Range(APInt(32, Min), APInt(32, Max + 1));
- IntegerRangeState RangeState(Range);
- clampStateAndIndicateChange(this->getState(), RangeState);
- indicateOptimisticFixpoint();
- };
-
- std::pair<unsigned, unsigned> MaxWavesPerEURange{
- 1U, InfoCache.getMaxWavesPerEU(*F)};
-
// If the attribute exists, we will honor it if it is not the default.
if (auto Attr = InfoCache.getWavesPerEUAttr(*F)) {
+ std::pair<unsigned, unsigned> MaxWavesPerEURange{
+ 1U, InfoCache.getMaxWavesPerEU(*F)};
if (*Attr != MaxWavesPerEURange) {
- TakeRange(*Attr);
+ auto [Min, Max] = *Attr;
+ ConstantRange Range(APInt(32, Min), APInt(32, Max + 1));
+ IntegerRangeState RangeState(Range);
+ this->getState() = RangeState;
+ indicateOptimisticFixpoint();
----------------
arsenm wrote:
I don't want to bake in the assumption it's only set on kernels. This is an artificial restriction we shouldn't really have. Everywhere else properly handles waves per eu on functions
https://github.com/llvm/llvm-project/pull/123995
More information about the llvm-branch-commits
mailing list