<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">ransformation.<br>
 class LoopRotate {<br>
----------------<br>
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.<br>
<br>
Specifically, BreakCriticalEdges:174, PN->getBasicBlockIndex may return -1, and threre is no check for that here.<br></blockquote><div><br></div><div>I can't see how this could ever legally return -1 in this function., can you give an example?</div><div><br></div><div>It's looking at phi nodes in a successor, and trying to find the node that corresponds to a predecessor.</div><div>It should always exist.</div><div><br></div><div>That is,</div><div><br></div><div>It has a terminator and the block the terminator is in, and is looking at phi nodes in the successor block.</div><div>It tries to find the terminator block in the phi node.</div><div><br></div><div>How could this ever fail?<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
      if (PN->getIncomingBlock(BBIdx) != TIBB)<br>
        BBIdx = PN->getBasicBlockIndex(TIBB);<br>
      PN->setIncomingBlock(BBIdx, NewBB);<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<a href="https://reviews.llvm.org/D22630" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D22630</a><br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div></div>