[Mlir-commits] [mlir] [mlir][xegpu] Lower dynamic high-D nd load/store via base-pointer fold (PR #215711)
Charitha Saumya
llvmlistbot at llvm.org
Wed Aug 12 11:47:49 PDT 2026
================
@@ -777,9 +777,15 @@ bool xegpu::requirePacked(const xegpu::DistributeLayoutAttr layout) {
if (!layout)
return false;
auto laneData = layout.getEffectiveLaneDataAsInt();
- if (laneData.size() != 2)
+ // Packing (VNNI) applies to the innermost 2 dims. A >2D layout is accepted
+ // only when its leading (batch) dims are unit; packed iff lane_data[rank-2]
+ // (the second-to-last, "col") dim is not 1.
+ if (laneData.size() < 2)
return false;
- return laneData[0] != 1;
+ for (int64_t d : ArrayRef<int64_t>(laneData).drop_back(2))
+ if (d != 1)
+ return false;
----------------
charithaintc wrote:
same code in multiple places repeated. requirePacked, requireTranspose ([XeGPUUtils.cpp:777-812](vscode-webview://1g2nc5e7ncml9ih21p0ur9hdku9mqlr5racf6cc25akapfu9dfa5/mlir/lib/Dialect/XeGPU/Utils/XeGPUUtils.cpp#L777-L812)) and getMaybeLaneData, getMaybeLaneLayout.
worth putting in a helper for reuse.
https://github.com/llvm/llvm-project/pull/215711
More information about the Mlir-commits
mailing list