[Mlir-commits] [mlir] [mlir][vector] Extend `ShapeCastCreateMaskFolderTrailingOneDim` (PR #219494)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Sep 3 01:48:45 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 -- mlir/lib/Dialect/Vector/IR/VectorOps.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/Vector/IR/VectorOps.cpp b/mlir/lib/Dialect/Vector/IR/VectorOps.cpp
index 6cc3f990c..ad5e21a20 100644
--- a/mlir/lib/Dialect/Vector/IR/VectorOps.cpp
+++ b/mlir/lib/Dialect/Vector/IR/VectorOps.cpp
@@ -7025,7 +7025,7 @@ enum class UnitDimSide { Leading, Trailing };
 ///    %2 = vector.shape_cast %1 : vector<1x1x[4]x1xi1> to vector<[4]x1xi1>
 /// AFTER:
 ///    %0 = vector.create_mask %c1, %dim : vector<[4]xi1>
-template<UnitDimSide Side>
+template <UnitDimSide Side>
 class ShapeCastCreateMaskFolderBoundaryUnitDim final
     : public OpRewritePattern<ShapeCastOp> {
 public:
@@ -7101,7 +7101,8 @@ public:
 
       // Check that every mask-dim-size to-be-dropped is constant and == 1. We
       // could also check for == 0, but that's left as a TODO.
-      if (llvm::any_of(maskDimSizesToDrop, [](int64_t dim) { return dim != 1; }))
+      if (llvm::any_of(maskDimSizesToDrop,
+                       [](int64_t dim) { return dim != 1; }))
         return failure();
 
       ArrayRef<int64_t> newMaskDimSizes =

``````````

</details>


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


More information about the Mlir-commits mailing list