[Mlir-commits] [mlir] [mlir][XeGPU][VectorToXeGPU] Propagate vector layouts to xegpu ops (PR #163071)
    Charitha Saumya 
    llvmlistbot at llvm.org
       
    Thu Oct 23 11:58:31 PDT 2025
    
    
  
================
@@ -374,22 +388,30 @@ static Value computeOffsets(PatternRewriter &rewriter, OpType gatScatOp,
         arith::AddIOp::create(rewriter, loc, baseOffset, offsetContrib);
   }
   Value indices = gatScatOp.getIndices();
+  // Extract indices layout and propagate it to all 'vector' ops created here
+  auto indicesLayout = mlir::xegpu::getDistributeLayoutAttr(indices);
   VectorType vecType = cast<VectorType>(indices.getType());
----------------
charithaintc wrote:
I am not 100% up to date on the requirement here. but as a rule of thumb, I would just focus on setting the layouts properly for xegpu operations that have some layout information in its definition (loads/stores/createNd etc). These layouts will not be lost during transformations. 
For all other arith ops that are generated as a part of this lowering, we can safely ignore the layouts because layout propagation should be able to take care of them (no need to replicate logic). But if certain op require a non-default layout for some reason then it should carry that information. But I highly doubt this will be the case. 
https://github.com/llvm/llvm-project/pull/163071
    
    
More information about the Mlir-commits
mailing list