[Mlir-commits] [mlir] [mlir][AMDGPU] Set uniform-work-group-size=true by default (PR #79077)

Matt Arsenault llvmlistbot at llvm.org
Tue Feb 13 10:38:16 PST 2024


================
@@ -100,6 +100,12 @@ class ROCDLDialectLLVMIRTranslationInterface
         llvmFunc->addFnAttr("amdgpu-flat-work-group-size", "1,256");
       }
 
+      // MLIR's GPU kernel APIs all assume and produce uniformly-sized
+      // workgroups, so the lowering of the `rocdl.kernel` marker encodes this
+      // assumption. This assumption may be overridden by setting
+      // `rocdl.uniform_work_group_size` on a given function.
+      if (!llvmFunc->hasFnAttribute("uniform-work-group-size"))
----------------
arsenm wrote:

Why do you need to check if the attribute is already set on the function? Aren't you constructing this fresh IR?

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


More information about the Mlir-commits mailing list