[Mlir-commits] [mlir] c62768b - [MLIR][NVVM] Fix valid range of ord in tensormap.replace op (#202853)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Jun 12 09:02:24 PDT 2026


Author: Srinivasa Ravi
Date: 2026-06-12T21:32:18+05:30
New Revision: c62768b10e5e16c494eef8289452a7d7d97798bf

URL: https://github.com/llvm/llvm-project/commit/c62768b10e5e16c494eef8289452a7d7d97798bf
DIFF: https://github.com/llvm/llvm-project/commit/c62768b10e5e16c494eef8289452a7d7d97798bf.diff

LOG: [MLIR][NVVM] Fix valid range of ord in tensormap.replace op (#202853)

Fixes the valid range of the `ord` attribute in the NVVM dialect
`tensormap.replace` op to be `0-4` as indicated in the PTX ISA.

PTX ISA Reference:
https://docs.nvidia.com/cuda/parallel-thread-execution/#data-movement-and-conversion-instructions-tensormap-replace

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
    mlir/test/Target/LLVMIR/nvvm/tensormap_replace_invalid.mlir

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td b/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
index 16994d487802f..609c0f9bb5a29 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
@@ -6896,7 +6896,7 @@ def NVVM_TensormapReplaceOp : NVVM_VoidIntrinsicOp<"tensormap.replace",
     TensormapFieldAttr:$field,
     AnyTypeOf<[LLVM_PointerGlobal, LLVM_PointerShared]>:$addr,
     Optional<AnyTypeOf<[I64, I32]>>:$new_value,
-    OptionalAttr<ConfinedAttr<I32Attr, [IntMinValue<1>, IntMaxValue<5>]>>:$ord,
+    OptionalAttr<ConfinedAttr<I32Attr, [IntMinValue<0>, IntMaxValue<4>]>>:$ord,
     OptionalAttr<TensormapFieldValueAttr>:$new_value_attr
   );
 

diff  --git a/mlir/test/Target/LLVMIR/nvvm/tensormap_replace_invalid.mlir b/mlir/test/Target/LLVMIR/nvvm/tensormap_replace_invalid.mlir
index 245a5da40ab9f..21454491f218a 100644
--- a/mlir/test/Target/LLVMIR/nvvm/tensormap_replace_invalid.mlir
+++ b/mlir/test/Target/LLVMIR/nvvm/tensormap_replace_invalid.mlir
@@ -27,7 +27,7 @@ llvm.func @tensormap_replace_invalid_ordinal(%addr : !llvm.ptr<1>, %new_val : i3
 // -----
 
 llvm.func @tensormap_replace_ordinal_out_of_range(%addr : !llvm.ptr<1>, %new_val : i32) {
-  // expected-error @+1 {{attribute 'ord' failed to satisfy constraint: 32-bit signless integer attribute whose minimum value is 1 whose maximum value is 5}}
+  // expected-error @+1 {{attribute 'ord' failed to satisfy constraint: 32-bit signless integer attribute whose minimum value is 0 whose maximum value is 4}}
   nvvm.tensormap.replace field = box_dim[6], new_value = %new_val in %addr : !llvm.ptr<1>, i32
   llvm.return
 }


        


More information about the Mlir-commits mailing list