[Mlir-commits] [mlir] [mlir][xegpu] Add xegpu-canonicalize pass to un-flatten gather/scatter (PR #218292)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sun Aug 23 14:43:06 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 h,cpp -- mlir/lib/Dialect/XeGPU/Transforms/XeGPUCanonicalize.cpp mlir/include/mlir/Dialect/XeGPU/Transforms/Transforms.h mlir/lib/Dialect/GPU/Pipelines/GPUToXeVMPipeline.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/Transforms/XeGPUCanonicalize.cpp b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUCanonicalize.cpp
index eb062a3a4..92b3d677c 100644
--- a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUCanonicalize.cpp
+++ b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUCanonicalize.cpp
@@ -91,12 +91,14 @@ static Value unflatten(PatternRewriter &rewriter, Value flat,
 /// ```mlir
 /// // Before:
 /// %cst = arith.constant dense<0.0> : vector<8192xbf16>
-/// %flat_idx = vector.shape_cast %idx : vector<128x64xindex> to vector<8192xindex>
-/// %flat_mask = vector.shape_cast %mask : vector<128x64xi1> to vector<8192xi1>
-/// %flat_res = vector.gather %src[%c0] [%flat_idx], %flat_mask, %cst
+/// %flat_idx = vector.shape_cast %idx : vector<128x64xindex> to
+/// vector<8192xindex> %flat_mask = vector.shape_cast %mask : vector<128x64xi1>
+/// to vector<8192xi1> %flat_res = vector.gather %src[%c0] [%flat_idx],
+/// %flat_mask, %cst
 ///     : memref<?xbf16>, vector<8192xindex>, vector<8192xi1>, vector<8192xbf16>
 ///       into vector<8192xbf16>
-/// %res = vector.shape_cast %flat_res : vector<8192xbf16> to vector<128x64xbf16>
+/// %res = vector.shape_cast %flat_res : vector<8192xbf16> to
+/// vector<128x64xbf16>
 ///
 /// // After:
 /// %cst = arith.constant dense<0.0> : vector<128x64xbf16>

``````````

</details>


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


More information about the Mlir-commits mailing list