[llvm] [AMDGPU] Handle unset/max flat workgroup size in waves/EU (PR #139955)

Nikolay Panchenko via llvm-commits llvm-commits at lists.llvm.org
Wed May 14 14:10:15 PDT 2025


================
@@ -1170,13 +1170,19 @@ struct AAAMDWavesPerEU : public AAAMDSizeRangeAttribute {
           !AssumedGroupSize->isValidState())
         return false;
 
+      unsigned MinFWGSize =
+          AssumedGroupSize->getAssumed().getLower().getZExtValue();
+      unsigned MaxFWGSize =
+          AssumedGroupSize->getAssumed().getUpper().getZExtValue();
+      if (MinFWGSize == 0 && MaxFWGSize == 0)
+        std::tie(MinFWGSize, MaxFWGSize) =
+            InfoCache.getDefaultFlatWorkGroupSize(*Func);
----------------
npanchen wrote:

can you elaborate why ? Isn't it always safe (correctness-wise) to use max that function allows  ?

https://github.com/llvm/llvm-project/pull/139955


More information about the llvm-commits mailing list