[Mlir-commits] [mlir] [MLIR][XeGPU][XeVM] create_nd_tdesc: use correct pitch from strides. (PR #170384)

Jianhui Li llvmlistbot at llvm.org
Wed Dec 3 09:33:29 PST 2025


================
@@ -179,11 +178,10 @@ class CreateNdDescToXeVMPattern
     Value baseAddr;
     Value baseShapeW;
     Value baseShapeH;
-    Value offsetW;
-    Value offsetH;
 
     // Source can be a memref or a pointer (ui64, ui32, i64 or i32).
     SmallVector<OpFoldResult> mixedSizes = op.getMixedSizes();
+    SmallVector<OpFoldResult> mixedStrides = op.getMixedStrides();
----------------
Jianhui-Li wrote:

We should differentiate the source being a memref or a pointer. For pointer,  user is expected to provide both shapes and strides, so the above code works fine.
But for memref, the code should extract the strides from memref. For dynamic shape memref, this will trigger the ExtractStridedMetadataOp again (after the one in the type conversion to get base addr and offset) but I guess it should be removed in the llvm level. 


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


More information about the Mlir-commits mailing list