[PATCH] D34135: [LVI] Add initial result to avoid infinite getValueFromCondition recursion

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 15 08:03:55 PDT 2017


anna added a comment.

In https://reviews.llvm.org/D34135#780695, @dberlin wrote:

> In https://reviews.llvm.org/D34135#780666, @anna wrote:
>
> > In https://reviews.llvm.org/D34135#780637, @efriedma wrote:
> >
> > > The sequence here is that we constant-fold a terminator (deleting an edge), then continue iterating through all the blocks in the function, and eventually crash when LVI discovers a cycle in a loop which was made unreachable.
> >
> >
> > So, the main problem here is that in each iteration of Jump threading, we can find the trivially dead blocks, but not the complete set of unreachable blocks. Also, I'm assuming transitively detecting dead blocks after the call to `processBlock` does not help in this case?
>
>
> The set of blocks it will find will depend on input order of basic blocks currently.
>  It is possible to increase it to find all non-cycle involved unreachable blocks  by performing the processing in the optimal iteration order.
>  It should be possible to find all unreachable blocks (including those involved in cycle) as you go by forming SCC's and iterating them individually in the right order.


Agreed. Also, there was even a discussion on changing the ordering for JumpThreading because of how the current ordering can cause certain blocks to be dead, and AA chokes on the PHIs in those blocks: https://bugs.llvm.org/show_bug.cgi?id=33142#c14
(This might be completely irrelevant for this patch, but it's around the same problem of identifying  unreachability at all times in JumpThreading).


https://reviews.llvm.org/D34135





More information about the llvm-commits mailing list