[Mlir-commits] [mlir] [mlir][XeGPU] Add optional layout attribute to LoadGather StoreScatter ops (PR #163414)

Dmitry Chigarev llvmlistbot at llvm.org
Mon Nov 3 06:37:37 PST 2025


dchigarev wrote:

@charithaintc @Jianhui-Li 

updated the PR according to our discussion:

1. Permament layout attr never replaces the temporary attr, but only works as an addition:
```mlir
xegpu.load ... <{layout = ...}> {layout_result_0 = ...}
```
2. Propagate-layout pass back-propagates the permament layout, e.g.:
```mlir
//////// Case 1 (xegpu.load doesn't have a permament layout)
// input:
%3 = xegpu.load ...
xegpu.store %3 ... <{layout = #xegpu.layout<lane_layout = [8], lane_data = [1]>}>

// --propagate-layout:
%3 = xegpu.load ... {layout_result_0 = #xegpu.layout<lane_layout = [8], lane_data = [1]>}
xegpu.store %3 ... <{layout = #xegpu.layout<lane_layout = [8], lane_data = [1]>}>

//////// Case 2 (xegpu.load has a permament layout)
// input:
%3 = xegpu.load ... <{layout = #xegpu.layout<lane_layout = [16], lane_data = [1]>}>
xegpu.store %3 ... <{layout = #xegpu.layout<lane_layout = [8], lane_data = [1]>}>

// --propagate-layout:
// the pass doesn't overwrite the permament layout
%3 = xegpu.load ... <{layout = #xegpu.layout<lane_layout = [16], lane_data = [1]>}> {
    layout_result_0 = #xegpu.layout<lane_layout = [16], lane_data = [1]>}
xegpu.store %3 ... <{layout = #xegpu.layout<lane_layout = [8], lane_data = [1]>}>
```
3. All the passes that work with layouts (wg-to-sg, xegpu-unroll, ...) use temp layout


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


More information about the Mlir-commits mailing list