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

Jianhui Li llvmlistbot at llvm.org
Mon Oct 20 12:02:16 PDT 2025


================
@@ -136,9 +136,9 @@ gpu.module @xevm_module{
     %1 = arith.constant {layout_result_0 = #xegpu.layout<lane_layout = [16], lane_data = [1]>} dense<1>: vector<16xi1>
     %offset = arith.constant {layout_result_0 = #xegpu.layout<lane_layout = [16], lane_data = [1]>} dense<12> : vector<16xindex>
     %loaded = scf.if %pred -> (vector<16x8xf16>) {
-      %3 = xegpu.load %src[%offset], %1 <{chunk_size=8}> {
-        layout_result_0 = #xegpu.layout<lane_layout = [16, 1], lane_data = [1, 2]>
-      } : memref<256xf16>, vector<16xindex>, vector<16xi1> -> vector<16x8xf16>
+      %3 = xegpu.load %src[%offset], %1 <{chunk_size=8, 
+        layout = #xegpu.layout<lane_layout = [16, 1], lane_data = [1, 2]>
----------------
Jianhui-Li wrote:

I would leave these two tests as is, since they are testing the behavior for the default layout if user don't set anything to the anchor op. 

Instead, I would just create separate test for user to set a different layout like 
layout = #xegpu.layout<lane_layout = [4, 4], lane_data = [1, 2] 
for store and expect it propagating from store to load. 
The tests could be simply without if, but just check the override behavior (once user set it, the propogation should honor user's setting). 

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


More information about the Mlir-commits mailing list