[Mlir-commits] [mlir] [mlir] Add fast walk-based pattern rewrite driver (PR #113825)
Jakub Kuderski
llvmlistbot at llvm.org
Sun Oct 27 17:48:19 PDT 2024
================
@@ -320,15 +320,33 @@ conversion target, via a set of pattern-based operation rewriting patterns. This
framework also provides support for type conversions. More information on this
driver can be found [here](DialectConversion.md).
+### Walk Pattern Rewrite Driver
+
+This is a fast and simple driver that walks the given op and applies patterns
+that locally have the most benefit. The benefit of a pattern is decided solely
+by the benefit specified on the pattern, and the relative order of the pattern
+within the pattern list (when two patterns have the same local benefit).
+
+This driver does not (re)visit modified or newly replaced ops, and does not
+allow for progressive rewrites of the same op. Op erasure is only supported for
----------------
kuhar wrote:
Same as https://github.com/llvm/llvm-project/pull/113825#discussion_r1818242195 -- I'd appreciate suggestions.
One alternative that I considered was first doing a walk without any rewrites and collecting the ops in a vector. Then the erasure listener kept track of all the erased ops so that they won't accidentally be visited (e.g., erased users). If we go back to this implementation, it should be easier to handle erasure. WDYT?
https://github.com/llvm/llvm-project/pull/113825
More information about the Mlir-commits
mailing list