[llvm] [mlir] [mlir][core] Add an MLIR "pattern catalog" generator (PR #146228)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 30 10:32:57 PDT 2025


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 HEAD~1 HEAD --extensions cpp,h -- mlir/lib/IR/CatalogingListener.cpp mlir/include/mlir/IR/PatternMatch.h mlir/lib/Rewrite/PatternApplicator.cpp
``````````

</details>

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

``````````diff
diff --git a/mlir/lib/Rewrite/PatternApplicator.cpp b/mlir/lib/Rewrite/PatternApplicator.cpp
index 210336afb..2771c90c2 100644
--- a/mlir/lib/Rewrite/PatternApplicator.cpp
+++ b/mlir/lib/Rewrite/PatternApplicator.cpp
@@ -212,10 +212,11 @@ LogicalResult PatternApplicator::matchAndRewrite(
 #ifndef NDEBUG
             OpBuilder::Listener *oldListener = rewriter.getListener();
             auto catalogingListener =
-                std::make_unique<RewriterBase::CatalogingListener>(oldListener,
-                                                     pattern->getDebugName());
+                std::make_unique<RewriterBase::CatalogingListener>(
+                    oldListener, pattern->getDebugName());
             rewriter.setListener(catalogingListener.get());
-            llvm::make_scope_exit([&] { rewriter.setListener(oldListener); };
+            llvm::make_scope_exit([&] {
+          rewriter.setListener(oldListener); };
 #endif
             result = pattern->matchAndRewrite(op, rewriter);
             LLVM_DEBUG(llvm::dbgs()

``````````

</details>


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


More information about the llvm-commits mailing list