[Mlir-commits] [mlir] [mlir][xegpu] Fix high-D nd base_height for non-packed plane strides (PR #225556)
Charitha Saumya
llvmlistbot at llvm.org
Wed Sep 30 12:49:39 PDT 2026
================
@@ -214,27 +214,30 @@ translateStoreXeGPUCacheHint(std::optional<xegpu::CachePolicy> L1hint,
//
// High-D (>2D) nd descriptors are lowered by viewing the source as a single
-// flattened 2D plane: `base_height` is the product of all dims but the
-// innermost, so the 2D-block surface covers every leading (batch) plane at
-// once, and a batch position becomes a row offset into it. Leaving `base_ptr`
-// at the true base means an out-of-range batch index lands past `base_height`,
-// where the HW boundary check handles it, instead of aiming the surface at
-// unmapped memory. Encoding the leading strides as row counts (`stride[d] /
-// stride[R-2]`) also makes them dimensionless, so they survive element-type
-// repacking (e.g. the f16 -> i32 transpose repack) without a unit conversion.
+// flattened 2D plane, so the 2D-block surface covers every leading (batch)
+// plane at once and a batch position becomes a row offset into it. The surface
+// height is the row extent the leading dims reach:
+// base_height = size[R-2] + sum_d (size[d] - 1) * (stride[d] / stride[R-2])
----------------
charithaintc wrote:
why not simply use the last contagious dim of rows instead. this fits well with what HW expects.
https://github.com/llvm/llvm-project/pull/225556
More information about the Mlir-commits
mailing list