[Mlir-commits] [mlir] [MLIR] Fix ErasedOpsListener false positives for newly created ops/blocks (PR #192291)

Jakub Kuderski llvmlistbot at llvm.org
Thu Apr 16 06:52:24 PDT 2026


================
@@ -61,16 +62,38 @@ struct WalkAndApplyPatternsAction final
 // ops/blocks. Because we use walk-based pattern application, erasing the
 // op/block from the *next* iteration (e.g., a user of the visited op) is not
 // valid. Note that this is only used with expensive pattern API checks.
+//
+// Ops and blocks that were *created* during the current pattern application are
+// exempt: they were not in the walk schedule before the pattern ran, so erasing
+// them cannot disrupt the walk.
----------------
kuhar wrote:

Maybe spell out what you mean by 'disrupt the walk'? I think this is strictly related to the iteration invalidation from above.

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


More information about the Mlir-commits mailing list