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

Jianhui Li llvmlistbot at llvm.org
Fri Aug 21 22:11:02 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) {
----------------
Jianhui-Li wrote:

added hasStaticShapeAndStrides() utility

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


More information about the Mlir-commits mailing list