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

Matt Arsenault llvmlistbot at llvm.org
Tue Feb 13 23:17:30 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:

This seems like a peculiar process but I have no idea how MLIR does things. I'd expect it to look like clang where the full set of attributes is considered when initially emitting the IR attributes 

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


More information about the Mlir-commits mailing list