[Mlir-commits] [mlir] [MLIR][ROCDL] Add conversion for gpu.subgroup_id to ROCDL (PR #136405)

Krzysztof Drewniak llvmlistbot at llvm.org
Tue Apr 22 13:48:32 PDT 2025


================
@@ -204,6 +204,15 @@ def ROCDL_ReadlaneOp : ROCDL_IntrOp<"readlane", [], [0], [AllTypesMatch<["res",
    }];
 }
 
+// The LLVM intrinsic function name is rather mouthful,
+// so here we opt to use a shorter rocdl name.
+def ROCDL_WaveIdOp :  LLVM_IntrOpBase<ROCDL_Dialect, "wave_id",
+                        "amdgcn_s_get_waveid_in_workgroup", [], [], [], 1>,
----------------
krzysz00 wrote:

Also, as a side note, the "major version >= 10" check is, going off of `FeatureGetWaveIdInst` down in LLVM, wrong. This instruction only seems to appear on gfx101x, after which time it was removed.

I think the lowering for `subgroup_id` should be ID in workgroup % subgroup size

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


More information about the Mlir-commits mailing list