[PATCH] D41605: StructurizeCFG: Fix broken backedge detection

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 28 11:26:20 PST 2017


Fwiw it's been established that nvptx pre Volta needs this, or at least a
more limited version that puts  syncthreads calls at the end of a
single-entrance single-exit region.  The reason we haven't just turned it
on is, as you say, it seems quite buggy as-is, and I also wasn't able to
understand its algorithm.

I hope we'll be able to look at this in Q1 or Q2, although it's contingent
on a lot of things.  Currently I also think it's in need of a rewrite.

On Thu, Dec 28, 2017, 5:53 PM Matt Arsenault via Phabricator <
reviews at reviews.llvm.org> wrote:

> arsenm added a comment.
>
> In https://reviews.llvm.org/D41605#964650, @dberlin wrote:
>
> >
>
>
>
>
> > You would currently detect this as some form of loop, but again, most of
> the algorithms used here do not look like the ones i'm familiar with (I
> feel like i can find a ton of edge cases in it).
>
> There are definitely a lot of strange things going on here and I don't
> really understand how this manages to work at all. I think part of the
> problem was using RegionInfo for this was a mistake, and this should
> probably be rewritten to not depend on it. For example because the pass
> itself only sees one region at a time, it won't even see the example you
> posted as something it can try to process. There isn't a well formed single
> exit region, so I think the pass will just see the function top level
> region and bail out. I've variants of the same problem pop up from time to
> time. Fundamentally using an analysis to look at well formed regions
> probably doesn't make sense for a pass which is trying to produce well
> formed regions. I've also been surprised by some of the visitation order
> decisions for the various graph iterators with RegionNode compared to the
> same orders over the entire function. The various places that need to
> differently handle subregion nodes vs. individual blocks also seems more
> confusing to me.
>
>
> https://reviews.llvm.org/D41605
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171228/e7e06e1c/attachment.html>


More information about the llvm-commits mailing list