[Mlir-commits] [mlir] [MLIR][XeGPU] Enable WG-level mxfp GEMM via generalized shape_cast collapse inference (PR #201496)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Jun 3 20:09:09 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h -- mlir/include/mlir/Dialect/XeGPU/Utils/XeGPUUtils.h mlir/lib/Dialect/XeGPU/IR/XeGPUDialect.cpp mlir/lib/Dialect/XeGPU/Transforms/XeGPULayoutImpl.cpp mlir/lib/Dialect/XeGPU/Transforms/XeGPUUnroll.cpp mlir/lib/Dialect/XeGPU/Utils/XeGPUUtils.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/mlir/lib/Dialect/XeGPU/IR/XeGPUDialect.cpp b/mlir/lib/Dialect/XeGPU/IR/XeGPUDialect.cpp
index 64c04437c..42d370fcf 100644
--- a/mlir/lib/Dialect/XeGPU/IR/XeGPUDialect.cpp
+++ b/mlir/lib/Dialect/XeGPU/IR/XeGPUDialect.cpp
@@ -662,8 +662,8 @@ DistributeLayoutAttr LayoutAttr::collapseDims(SmallVector<int64_t> dimGroup) {
 //   - order: the original dim index is replaced by the expanded dim indices
 //     in innermost-fastest order; entries past `dim` shift up by
 //     `targetShape.size() - 1`.
-DistributeLayoutAttr
-LayoutAttr::expandDims(int64_t dim, ArrayRef<int64_t> targetShape) {
+DistributeLayoutAttr LayoutAttr::expandDims(int64_t dim,
+                                            ArrayRef<int64_t> targetShape) {
   SmallVector<int64_t> sgLayout = getEffectiveSgLayoutAsInt();
   SmallVector<int64_t> sgData = getEffectiveSgDataAsInt();
   SmallVector<int64_t> instData = getEffectiveInstDataAsInt();
@@ -715,8 +715,7 @@ LayoutAttr::expandDims(int64_t dim, ArrayRef<int64_t> targetShape) {
 
   // Splice `expanded` (length expCount) into `vec` at position `dim`,
   // replacing the single entry at `dim`.
-  auto splice = [&](SmallVector<int64_t> &vec,
-                    ArrayRef<int64_t> expanded) {
+  auto splice = [&](SmallVector<int64_t> &vec, ArrayRef<int64_t> expanded) {
     if (vec.empty())
       return;
     vec.erase(vec.begin() + dim);
@@ -826,9 +825,9 @@ LayoutAttr::expandDims(int64_t dim, ArrayRef<int64_t> targetShape) {
     SmallVector<int32_t> v32(v.begin(), v.end());
     return DenseI32ArrayAttr::get(getContext(), v32);
   };
-  return xegpu::LayoutAttr::get(
-      getContext(), toAttr(sgLayout), toAttr(sgData), toAttr(instData),
-      toAttr(laneLayout), toAttr(laneData), toAttr(newOrder));
+  return xegpu::LayoutAttr::get(getContext(), toAttr(sgLayout), toAttr(sgData),
+                                toAttr(instData), toAttr(laneLayout),
+                                toAttr(laneData), toAttr(newOrder));
 }
 
 // Derive a new layout by transpose the layout using `permutation`.
@@ -1344,7 +1343,7 @@ DistributeLayoutAttr SliceAttr::collapseDims(SmallVector<int64_t> dimGroup) {
 // expanded there, and the slice dims that lie past the expanded position
 // are shifted up by `targetShape.size() - 1`.
 DistributeLayoutAttr SliceAttr::expandDims(int64_t dim,
-                                            ArrayRef<int64_t> targetShape) {
+                                           ArrayRef<int64_t> targetShape) {
   // `dim` is in slice space; map it to parent space (parent dims listed in
   // `sliceDims` are removed by the slice, so the mapping always lands on a
   // non-sliced parent dim).

``````````

</details>


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


More information about the Mlir-commits mailing list