[PATCH] D35918: [GVNHoist] Factor out reachability to search for anticipable instructions quickly

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 26 15:47:48 PDT 2017


dberlin added a comment.



In https://reviews.llvm.org/D35918#822168, @hiraditya wrote:

> In https://reviews.llvm.org/D35918#822143, @dberlin wrote:
>
> > FYI: IDFCalculator can compute the PostDominanceFrontier in linear time.
>
>
> I was unable to find how to pass the root node of inverse graph, because there might be more than one root.
>  Thanks,


No.
The graph always has one root, virtual or not.
Once kuba's latest patch is committed, it will *always* be virtual, actually.

But i'm not sure why that would stop you one way or the other?
The IDF calculator only asks for the defining blocks, not the root.
You can hand it all CFG blocks and it should work fine.

What do you believe you need to hand it the root node for?

For example,the dominance frontier of the root node is guaranteed to be empty.
"the dominance frontier of a node d is the set of all nodes n such that d dominates an immediate predecessor of n, but d does not strictly dominate n."

The root node strictly dominates everything but itself,  and it has no immediate predecessors (successors on the reverse graph),.


https://reviews.llvm.org/D35918





More information about the llvm-commits mailing list