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

Mehdi Amini llvmlistbot at llvm.org
Thu Apr 16 04:08:59 PDT 2026


joker-eph wrote:

> Isn't this patch treating both "newly" created and "moved" ops as part of newlyCreatedOps? An already existing op that has moved is still something the walk should care for.

I'm not sure I get what you're getting at? Can you expand?

To be clear this whole patch is just changing an assertion, it not affecting any behavior. The check we're targeting is:

```
      llvm::report_fatal_error(
          "unsupported erasure in WalkPatternRewriter; "
          "erasure is only supported for matched ops and their descendants");
```

Basically the "erasure is only supported for matched ops and their descendants" is modified to not trigger on erasure in cases mentioned here.

The assertion is meant for protecting against these cases:

```
// 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
```



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


More information about the Mlir-commits mailing list