[PATCH] D22630: Loop rotation

Daniel Berlin via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 29 14:54:14 PDT 2016

> ransformation.
>  class LoopRotate {
> ----------------
> Using SplitEdge results in ICE because SplitEdge (for critical edges)
> tries to update PHI in a strange way. I think there is a bug in SplitEdge
> PHI update for single-entry PHIs. Moreover, loop-rotation needs to do its
> own PHI-update later anyways.
> Specifically, BreakCriticalEdges:174, PN->getBasicBlockIndex may return
> -1, and threre is no check for that here.

I can't see how this could ever legally return -1 in this function., can
you give an example?

It's looking at phi nodes in a successor, and trying to find the node that
corresponds to a predecessor.
It should always exist.

That is,

It has a terminator and the block the terminator is in, and is looking at
phi nodes in the successor block.
It tries to find the terminator block in the phi node.

How could this ever fail?

>       if (PN->getIncomingBlock(BBIdx) != TIBB)
>         BBIdx = PN->getBasicBlockIndex(TIBB);
>       PN->setIncomingBlock(BBIdx, NewBB);
> https://reviews.llvm.org/D22630
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160829/20a99897/attachment.html>

More information about the llvm-commits mailing list