[Mlir-commits] [mlir] [MLIR] Use applyOpPatternsGreedily instead of deprecated applyOpPatternsAndFold in documentation (PR #127379)

Letu Ren llvmlistbot at llvm.org
Sun Feb 16 00:13:14 PST 2025


https://github.com/FantasqueX updated https://github.com/llvm/llvm-project/pull/127379

>From 6245b89046f3a78d6736533ad2e51aa72c2c60ea Mon Sep 17 00:00:00 2001
From: Letu Ren <fantasquex at gmail.com>
Date: Sun, 16 Feb 2025 15:44:53 +0800
Subject: [PATCH 1/2] [MLIR] Use applyOpPatternsGreedily instead of deprecated
 applyOpPatternsAndFold in documentation

---
 mlir/docs/PatternRewriter.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mlir/docs/PatternRewriter.md b/mlir/docs/PatternRewriter.md
index d15e7e5a80678..9df4647299010 100644
--- a/mlir/docs/PatternRewriter.md
+++ b/mlir/docs/PatternRewriter.md
@@ -361,7 +361,7 @@ This driver comes in two fashions:
 *   `applyPatternsGreedily` ("region-based driver") applies patterns to
     all ops in a given region or a given container op (but not the container op
     itself). I.e., the worklist is initialized with all containing ops.
-*   `applyOpPatternsAndFold` ("op-based driver") applies patterns to the
+*   `applyOpPatternsGreedily` ("op-based driver") applies patterns to the
     provided list of operations. I.e., the worklist is initialized with the
     specified list of ops.
 

>From dbd0faefff54f8f011e37a8b8f0f4e4881282c31 Mon Sep 17 00:00:00 2001
From: Letu Ren <fantasquex at gmail.com>
Date: Sun, 16 Feb 2025 16:12:58 +0800
Subject: [PATCH 2/2] Remove applyOpPatternsAndFold in comment

---
 mlir/lib/Reducer/ReductionTreePass.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/mlir/lib/Reducer/ReductionTreePass.cpp b/mlir/lib/Reducer/ReductionTreePass.cpp
index 2d2744bfc2732..662ca7d00c409 100644
--- a/mlir/lib/Reducer/ReductionTreePass.cpp
+++ b/mlir/lib/Reducer/ReductionTreePass.cpp
@@ -56,12 +56,12 @@ static void applyPatterns(Region &region,
       opsInRange.push_back(&op.value());
   }
 
-  // `applyOpPatternsAndFold` may erase the ops so we can't do the pattern
+  // `applyOpPatternsGreedily` may erase the ops so we can't do the pattern
   // matching in above iteration. Besides, erase op not-in-range may end up in
-  // invalid module, so `applyOpPatternsAndFold` should come before that
+  // invalid module, so `applyOpPatternsGreedily` should come before that
   // transform.
   for (Operation *op : opsInRange) {
-    // `applyOpPatternsAndFold` returns whether the op is convered. Omit it
+    // `applyOpPatternsGreedily` returns whether the op is convered. Omit it
     // because we don't have expectation this reduction will be success or not.
     GreedyRewriteConfig config;
     config.strictMode = GreedyRewriteStrictness::ExistingOps;



More information about the Mlir-commits mailing list