[llvm] [DSE] Consider all dominating conditions in `dominatingConditionImpliesValue` (PR #181709)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 19 00:49:25 PST 2026


nikic wrote:

> > Otherwise you would probably want to walk the dom-tree and remember which relevant dominating conditions you currently know about.
> 
> I wonder if it may be worthwhile generalizing the approach in this PR to have instead a `DSEState::eliminateRedundantStoresUsingDomConditions()` to walk the dom-tree top-down, push `*Ptr == Val` facts (for children dominated by the node), and iterate over store later checking for redundancy, instead of the current approach of walking the dom-tree per-store.

Yes, this is what I had in mind. Doing this walk per-store is expensive.

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


More information about the llvm-commits mailing list