[llvm] [AMDGPU] Set TGID_EN_X/Y/Z when cluster ID intrinsics are used (PR #159120)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 17 02:21:20 PDT 2025


================
@@ -132,13 +132,16 @@ SIMachineFunctionInfo::SIMachineFunctionInfo(const Function &F,
   if (!AMDGPU::isGraphics(CC) ||
       ((CC == CallingConv::AMDGPU_CS || CC == CallingConv::AMDGPU_Gfx) &&
        ST.hasArchitectedSGPRs())) {
-    if (IsKernel || !F.hasFnAttribute("amdgpu-no-workgroup-id-x"))
+    if (IsKernel || !F.hasFnAttribute("amdgpu-no-workgroup-id-x") ||
+        !F.hasFnAttribute("amdgpu-no-cluster-id-x"))
       WorkGroupIDX = true;
 
-    if (!F.hasFnAttribute("amdgpu-no-workgroup-id-y"))
+    if (!F.hasFnAttribute("amdgpu-no-workgroup-id-y") ||
+        !F.hasFnAttribute("amdgpu-no-cluster-id-y"))
----------------
arsenm wrote:

Why isn't this &&? I'd also expect the original condition to be strong enough if the attributor understood the implied attribute? 

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


More information about the llvm-commits mailing list