[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


================
@@ -269,48 +301,86 @@ class XeGPUCreateNdDescOpPattern final
     auto convertType = tryOptimize(tdescTy, targetuArch);
     if (convertType == tdescTy)
       return failure();
-    auto strides = createNdOp.getMixedStrides();
-    auto maybeConstInnerStride = getConstantIntValue(strides.back());
+    Location loc = createNdOp.getLoc();
+    Value source = createNdOp.getSource();
+    auto memrefType = dyn_cast<MemRefType>(source.getType());
+
+    // A dynamic memref's shape/strides are recovered from runtime metadata
+    // (getMixedSizes/getMixedStrides can't represent a dynamic dim); a static
+    // one uses the op accessors directly.
+    auto isStaticMemref = [](MemRefType mt) {
----------------
charithaintc wrote:

this is reused in `XeGPUToXeVM` as well. Worth putting in Utils and reuse. 

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


More information about the Mlir-commits mailing list