[Mlir-commits] [mlir] [MLIR][XeGPU] Rematerialize layout conversion sources after conflict resolution (PR #230669)
Nishant Patel
llvmlistbot at llvm.org
Wed Oct 14 11:56:45 PDT 2026
================
----------------
nbpatel wrote:
Only a splat is free to recompute in any layout (every subgroup gets the same), a non-splat constant needs a per-subgroup slice that WgToSg can only produce for strided index constants, so cloning e.g. a non-splat f32 constant into a new layout would replace a lowerable convert_layout with a constant that fails to distribute.
For example,
#whole = #xegpu.layout<sg_layout = [4], sg_data = [8]>
#sliced = #xegpu.layout<sg_layout = [4], sg_data = [2]>
%c = arith.constant {layout_result_0 = #whole} dense<[1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]> : vector<8xf32>
%cvt = xegpu.convert_layout %c <{input_layout = #whole, target_layout = #sliced}> : vector<8xf32>
xegpu.store_nd %cvt, %tdesc[0] <{layout = #sliced}> : vector<8xf32>, !xegpu.tensor_desc<8xf32>
This above IR will work as is today but if we rematerialize it, it will become
%c' = arith.constant {layout_result_0 = #sliced} dense<[1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]> : vector<8xf32>
which fails because WgToSg only distributes non-splat with Index element type (and not floats)
https://github.com/llvm/llvm-project/pull/230669
More information about the Mlir-commits
mailing list