[Mlir-commits] [mlir] [mlir][XeGPU][VectorToXeGPU] Propagate vector layouts to xegpu ops (PR #163071)

Jianhui Li llvmlistbot at llvm.org
Tue Oct 28 23:01:07 PDT 2025


================
@@ -616,16 +636,34 @@ struct GatherLowering : public OpRewritePattern<vector::GatherOp> {
         computeOffsets(rewriter, gatherOp, meta.first, meta.second);
     Value flatMemref = memrefToIndexPtr(gatherOp, rewriter);
 
+    auto layoutRes = xegpu::getDistributeLayoutAttr(gatherOp.getResult());
----------------
Jianhui-Li wrote:

>We can take the layout from Result vector, and set to the store op's layout attribute (need to expand the op definition to make the attribute persistent, not lost after optimization passes).

one correction: I think we should not take the layout from the result or operand, since they are temporary so should not serve as our interface.  Instead, we should ask user to set the permanent layout associated with anchor op. 

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


More information about the Mlir-commits mailing list