[llvm-branch-commits] [mlir] [mlir][IR] Add listener notifications for pattern begin/end (PR #84131)

Matthias Springer via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Mar 7 21:13:15 PST 2024


================
@@ -68,9 +68,9 @@ class PatternApplicator {
   ///            invalidate the match and try another pattern.
   LogicalResult
   matchAndRewrite(Operation *op, PatternRewriter &rewriter,
-                  function_ref<bool(const Pattern &)> canApply = {},
-                  function_ref<void(const Pattern &)> onFailure = {},
-                  function_ref<LogicalResult(const Pattern &)> onSuccess = {});
+                  std::function<bool(const Pattern &)> canApply = {},
+                  std::function<void(const Pattern &)> onFailure = {},
+                  std::function<LogicalResult(const Pattern &)> onSuccess = {});
----------------
matthias-springer wrote:

(The existing code seemed to care about performance here; There were different `canApply` etc. depending on `NDEBUG`.)


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


More information about the llvm-branch-commits mailing list