[llvm] [mlir] [MLIR][NVVM] Add NVVMRequiresSM op trait (PR #126886)

Srinivasa Ravi via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 15 01:47:36 PDT 2025


================
@@ -167,14 +170,14 @@ class NVVM_SpecialRangeableRegisterOp<string mnemonic> :
 def NVVM_LaneIdOp : NVVM_SpecialRangeableRegisterOp<"read.ptx.sreg.laneid">;
 def NVVM_WarpSizeOp : NVVM_SpecialRangeableRegisterOp<"read.ptx.sreg.warpsize">;
 def NVVM_WarpIdOp : NVVM_SpecialRangeableRegisterOp<"read.ptx.sreg.warpid">;
-def NVVM_WarpDimOp : NVVM_SpecialRangeableRegisterOp<"read.ptx.sreg.nwarpid">;
+def NVVM_WarpDimOp : NVVM_SpecialRangeableRegisterOp<"read.ptx.sreg.nwarpid", [NVVMRequiresSM<20>]>;
----------------
Wolfram70 wrote:

It looks like `sm_20` is the minimum version for the Ops, so made that as the default in the `verifyTarget` function and removed it from the Ops. Thanks!

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


More information about the llvm-commits mailing list