================ @@ -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(); ---------------- shiltian wrote:
It will not because we will not run attributor more than once thus there is no intermediate values added. If a function has the attribute, it means it has to be a kernel function (at least for now since we only allow the attribute on kernel functions) and the value is chosen by users so we will honor it. https://github.com/llvm/llvm-project/pull/123995 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits