[PATCH] D81089: Mark InstCombine as not preserving PostDomTree

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 10 16:08:14 PDT 2020


efriedma added a comment.

Even if we agree the way the PostDominatorTree computes roots in cases involving infinite loops shouldn't depend on the ordering of successors, I'm not sure it's correct to say that instcombine "preserves the CFG".  Even for the regular DominatorTree, I think reordering the successors invalidates DFS numbering (in the sense that it changes the result of getDFSNumIn()).

In terms of how the PostDominatorTree should decide what a "root" is, I'm not sure there's any good way to make that decision. Given an SCC which doesn't have any natural parent, you can pick any node in that SCC as the "fake root", and there isn't any natural reason to favor one node over another.

Really, the natural choice is to just follow the standard dominator algorithm and say the nodes are unreachable.  Then for passes which want it, we can add a transform to mutate the CFG to introduce fake roots.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81089/new/

https://reviews.llvm.org/D81089





More information about the llvm-commits mailing list