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

Jianhui Li llvmlistbot at llvm.org
Tue Oct 28 21:29:08 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 don't think we need the new tests.  You don't need to change how the subgroup_distribute pass get the layout. It always get from the temporary layouts (the layout_result_* was set by propogation pass, and layout_operand_* set at the beginning of subgroup_distribute pass).  You don't have to test how subgroup_distribute get from the "layout" attribute. You only need to propogate from "layout" to "layout_result_*". 


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


More information about the Mlir-commits mailing list