<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p><br>
</p>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">
> I can't see how this could ever legally return -1 in this function., can you give an example?</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">
> It's looking at phi nodes in a successor, and trying to find the node that corresponds to a predecessor.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">
> It should always exist.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">
Yes, but in the case of loop-rotation when the PHIs have not yet been updated, the PHI in Successor BB only has one entry at that point.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">
So SplitEdge does not work. Sorry for the confusion.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">
<br>
</div>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Daniel Berlin <dberlin@dberlin.org><br>
<b>Sent:</b> Monday, August 29, 2016 3:54 PM<br>
<b>To:</b> reviews+D22630+public+f4f36d4d77d3fe89@reviews.llvm.org; Aditya Kumar<br>
<b>Cc:</b> Hal Finkel; Sanjoy Das; Michael Zolotukhin; llvm@meinersbur.de; Sebastian Pop; laxmansole@gmail.com; llvm-commits<br>
<b>Subject:</b> Re: [PATCH] D22630: Loop rotation</font>
<div> </div>
</div>
<div>
<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" id="LPlnk16009">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>
</div>
</div>
</div>
</body>
</html>