[Mlir-commits] [mlir] [mlir][CSE] Fix dominanceInfo analysis preservation (PR #192279)

lonely eagle llvmlistbot at llvm.org
Wed Apr 15 09:54:36 PDT 2026


linuxlonelyeagle wrote:

> > There is a remaining issue where the dominator trees in PostDominanceInfo are not updated because CSE does not depend on PostDominanceInfo.
> 
> If CSE does not mark it preserved, then there should be no issue. Can you clarify?

In this case, both DominanceInfo and PostDominanceInfo remain correct because they will recompute the dominator tree and populate the dominanceInfos map ( DenseMap<Region *, llvm::PointerIntPair<DomTree *, 1, bool>>).

Even if I mark them as preserved and run CSE to erase a region, it is still correct not to update DominanceInfo and PostDominanceInfo. Since the operations are deleted, they won't be accessed later. Furthermore, the cached dominator trees remain valid because a dominator tree represents relationships between blocks, and we aren't performing any operations on the blocks themselves.

As mentioned in the description, we are simply removing the dominator trees that correspond to the erased regions.

Since PostDominanceInfo is marked as preserved, I suspect it might also contain the dominator trees for the erased operations. This remains a legacy issue, as it could be the result of caching from a previous pass.

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


More information about the Mlir-commits mailing list