[llvm] [WIP][AMDGPU][Attributor] Make `AAAMDFlatWorkGroupSize` honor existing attribute (PR #114357)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 31 07:33:43 PDT 2024
================
@@ -767,11 +805,17 @@ struct AAAMDFlatWorkGroupSize : public AAAMDSizeRangeAttribute {
void initialize(Attributor &A) override {
Function *F = getAssociatedFunction();
+
auto &InfoCache = static_cast<AMDGPUInformationCache &>(A.getInfoCache());
- unsigned MinGroupSize, MaxGroupSize;
- std::tie(MinGroupSize, MaxGroupSize) = InfoCache.getFlatWorkGroupSizes(*F);
- intersectKnown(
- ConstantRange(APInt(32, MinGroupSize), APInt(32, MaxGroupSize + 1)));
+ std::optional<std::pair<unsigned, unsigned>> Attr =
+ InfoCache.getFlatWorkGroupSizeAttr(*F);
+
+ if (Attr.has_value()) {
----------------
arsenm wrote:
```suggestion
if (Attr) {
```
https://github.com/llvm/llvm-project/pull/114357
More information about the llvm-commits
mailing list