[Mlir-commits] [mlir] [mlir][nvgpu] Delete nvgpu dialect unused variable kMaxTMALastdimByte (NFC) (PR #155825)

lonely eagle llvmlistbot at llvm.org
Mon Sep 22 04:38:08 PDT 2025


https://github.com/linuxlonelyeagle updated https://github.com/llvm/llvm-project/pull/155825

>From bf5e47f72da93787c6f32cc652cc9aa8415fcfb7 Mon Sep 17 00:00:00 2001
From: linuxlonelyeagle <2020382038 at qq.com>
Date: Thu, 28 Aug 2025 12:09:45 +0000
Subject: [PATCH 1/2] delete kMaxTMALastdimByte

---
 mlir/include/mlir/Dialect/NVGPU/IR/NVGPUDialect.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/mlir/include/mlir/Dialect/NVGPU/IR/NVGPUDialect.h b/mlir/include/mlir/Dialect/NVGPU/IR/NVGPUDialect.h
index 61a57fb60bda4..b07e1a5beb866 100644
--- a/mlir/include/mlir/Dialect/NVGPU/IR/NVGPUDialect.h
+++ b/mlir/include/mlir/Dialect/NVGPU/IR/NVGPUDialect.h
@@ -46,8 +46,6 @@ constexpr unsigned kMaxTMATensorDimension = 5;
 /// to be traversed along each of the kMaxTMATensorDimension (tensorRank)
 /// dimensions, must be non-zero and less than or equal to 256.
 constexpr unsigned kMaxTMADimension = 256;
-/// Last dimension of 2D+ TMA must be 128 bytes
-constexpr unsigned kMaxTMALastdimByte = 128;
 
 #define GET_ATTRDEF_CLASSES
 #include "mlir/Dialect/NVGPU/IR/NVGPUAttrDefs.h.inc"

>From 6ceb72ba1e117f87d3dd6b6fef00c126d261a7ed Mon Sep 17 00:00:00 2001
From: linuxlonelyeagle <2020382038 at qq.com>
Date: Fri, 29 Aug 2025 14:05:59 +0000
Subject: [PATCH 2/2] update

---
 mlir/include/mlir/Dialect/NVGPU/IR/NVGPUDialect.h | 2 ++
 mlir/lib/Dialect/NVGPU/IR/NVGPUDialect.cpp        | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/mlir/include/mlir/Dialect/NVGPU/IR/NVGPUDialect.h b/mlir/include/mlir/Dialect/NVGPU/IR/NVGPUDialect.h
index b07e1a5beb866..ccee0de65caa5 100644
--- a/mlir/include/mlir/Dialect/NVGPU/IR/NVGPUDialect.h
+++ b/mlir/include/mlir/Dialect/NVGPU/IR/NVGPUDialect.h
@@ -46,6 +46,8 @@ constexpr unsigned kMaxTMATensorDimension = 5;
 /// to be traversed along each of the kMaxTMATensorDimension (tensorRank)
 /// dimensions, must be non-zero and less than or equal to 256.
 constexpr unsigned kMaxTMADimension = 256;
+/// The bytes in the last dimension of the tensor map must be a multiple of 16.
+constexpr unsigned kTMALastdimByte = 16;
 
 #define GET_ATTRDEF_CLASSES
 #include "mlir/Dialect/NVGPU/IR/NVGPUAttrDefs.h.inc"
diff --git a/mlir/lib/Dialect/NVGPU/IR/NVGPUDialect.cpp b/mlir/lib/Dialect/NVGPU/IR/NVGPUDialect.cpp
index 8474244c7d7c0..697cb35a59a28 100644
--- a/mlir/lib/Dialect/NVGPU/IR/NVGPUDialect.cpp
+++ b/mlir/lib/Dialect/NVGPU/IR/NVGPUDialect.cpp
@@ -424,7 +424,7 @@ std::optional<InFlightDiagnostic> verifyTmaDescriptorWithMemref(
 
   int lastDimBytes =
       descMemref.getShape().back() * descMemref.getElementTypeBitWidth() / 8;
-  if (lastDimBytes % 16 != 0) {
+  if (lastDimBytes % kTMALastdimByte != 0) {
     return op->emitError() << "the bytes in the last dimension of the tensor "
                               "map must be a multiple of 16";
   }



More information about the Mlir-commits mailing list