[Mlir-commits] [mlir] [MLIR][XeGPU][VectorToXeGPU] Add lowering from vector.gather/scatter to xegpu.load/store (PR #158024)

Dmitry Chigarev llvmlistbot at llvm.org
Tue Sep 16 03:03:40 PDT 2025


================
@@ -232,8 +254,14 @@ computeMemrefMeta(VectorTransferOpInterface xferOp, PatternRewriter &rewriter) {
     if (!offsetVal)
       offsetVal = meta.getOffset();
   }
-  // Adjust strides according to the permutation map (e.g., for transpose)
-  adjustStridesForPermutation(permMap, strides);
+
+  if constexpr (llvm::is_one_of<std::decay_t<OpType>, vector::TransferReadOp,
+                                vector::TransferWriteOp>::value) {
+    AffineMap permMap = xferOp.getPermutationMap();
----------------
dchigarev wrote:

here we're accessing a permutation map of the operation (transfer_read/write). `vector.gather/scatter` don't have a permutation map, that's why we're skipping it in that case

If a memref has its own permutation this should be handled automatically by `memref.extract_strided_metadata`

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


More information about the Mlir-commits mailing list