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

Aditya Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 27 15:33:02 PDT 2017


hiraditya added a comment.

In https://reviews.llvm.org/D35918#822192, @dberlin wrote:

> 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 I understand is that the API of IDFCalculator::calculate, populates a vector with all the dominance frontiers of the  defining blocks (AFAICT from the usage in ADCE.cpp).
How can I create a mapping of a basic block vs. its (post) dominance frontier. For this pass I would need to have such a mapping. I guess I'm having difficulty understanding the code. THanks for the help.

> 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