[PATCH] D31843: [LCSSA] Try to not walk the dominator tree more than necessary

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 10 17:11:02 PDT 2017


dberlin added a comment.

In https://reviews.llvm.org/D31843#722874, @mzolotukhin wrote:

> > This is precisely equivalent to the stack algorithm i outlined.
>
> I didn't refresh the page before posting, sorry :)
>
> Regarding your description: why do we need to sort exits and then check if the current block dominates an exit/other blocks from the set? 
>  Don't we get that for free just from the way we're building the set? I.e. we started from the set of exiting blocks - they all dominate at least one exit by definition.


Yes, i didn't pay attention to the details of the incoming set.
Your algorithm and mine will generate the same set.
They just enumerate them in opposite directions :)
(mine top down, yours bottom up)

SGTM if yours is easier :)

I assume it is not possible for an exit to dominate another exit given the way we define loop exits
(IE walking up, you will never hit another exit)


https://reviews.llvm.org/D31843





More information about the llvm-commits mailing list