[Mlir-commits] [mlir] [mlir] Avoid rewriting unreachable blocks in the greedy driver (PR #225814)

Mehdi Amini llvmlistbot at llvm.org
Sat Sep 26 05:28:39 PDT 2026


================

----------------
joker-eph wrote:

Nice catch, this was a gap....

The easy fix is to walk up the IR when checking for reachability, but that's on the hot path (every op), so I went with a change in the listener instead, but that's much more involved...
There is now a cache for ancestor  reachability (mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp:802).
Listener notifications invalidate that cache when a region-owning operation moves or the CFG changes.

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


More information about the Mlir-commits mailing list