[Mlir-commits] [mlir] [MLIR][XeGPU] Add sg layout propagation (PR #170879)

Jianhui Li llvmlistbot at llvm.org
Wed Dec 10 09:20:29 PST 2025


================
@@ -538,6 +538,56 @@ bool LayoutInfoPropagation::hasParamsOfLayoutKind(
   return false;
 }
 
+FailureOr<std::pair<SmallVector<int>, SmallVector<int>>>
+chooseLayout(llvm::ArrayRef<int64_t> big, llvm::ArrayRef<int> small,
----------------
Jianhui-Li wrote:

The issue is that this function doesn't give "stable" layout between different tensors, say A, B, and C of matmul may get different layout, then brings unnecessary and expensive cross-sg layout conversion. 
A simple solution should not look at the tensor sizes (like wg_tile and sg_tile size), just look at the num_sg and tile dimension and decide the layout that works regardless the tensor size.  Say, if we get 32 number of sg, then it simply returns 4x8 for 2d tile. 

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


More information about the Mlir-commits mailing list