[Mlir-commits] [mlir] [mlir][xegpu] Lower dynamic high-D nd load/store via base-pointer fold (PR #215711)

Charitha Saumya llvmlistbot at llvm.org
Wed Aug 12 11:47:47 PDT 2026


================
@@ -398,6 +439,36 @@ class LoadStorePrefetchNdToXeVMPattern : public OpConversionPattern<OpType> {
                                                     mixedOffsets[tileRank - 2]);
       offsetH = getValueOrCreateCastToIndexLike(rewriter, loc,
                                                 rewriter.getI32Type(), offsetH);
+      // Fold the leading (batch) offsets into the base pointer:
+      //   basePtr += (sum_d offset[d] * leadingStride[d]) * elemBytes
+      // using the batch strides encoded at create time. This keeps the 2D-block
+      // surface at the innermost matrix, avoiding the HW surface-size limits.
+      if (tileRank > 2) {
----------------
charithaintc wrote:

shouldn't we check if the leading dims are unit here? otherwise `encodeVectorType` can return wrong type without looking at leading dims. 

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


More information about the Mlir-commits mailing list