<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Oct 1, 2016 at 9:25 AM, Mehdi Amini <span dir="ltr"><<a href="mailto:mehdi.amini@apple.com" target="_blank">mehdi.amini@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><span class=""><blockquote type="cite"><div>On Oct 1, 2016, at 9:22 AM, Daniel Berlin <<a href="mailto:dberlin@dberlin.org" target="_blank">dberlin@dberlin.org</a>> wrote:</div><br class="m_-3196979303694865792Apple-interchange-newline"><div><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div class="gmail_quote" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div dir="ltr">On Sat, Oct 1, 2016, 9:36 AM David Callahan <<a href="mailto:dcallahan@fb.com" target="_blank">dcallahan@fb.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">david2050 added inline comments.<br class="m_-3196979303694865792gmail_msg"><br class="m_-3196979303694865792gmail_msg"><br class="m_-3196979303694865792gmail_msg">> dberlin wrote in ADCE.cpp:217<br class="m_-3196979303694865792gmail_msg">> I don't think this does what you think.<br class="m_-3196979303694865792gmail_msg">> The order here is not actually guaranteed to be in any particular order, AFAIK.<br class="m_-3196979303694865792gmail_msg">><br class="m_-3196979303694865792gmail_msg">> It happens most things produce blocks in lexical order, but this is not guaranteed (again, AFAIK)<br class="m_-3196979303694865792gmail_msg">><br class="m_-3196979303694865792gmail_msg">> Thus, it's entirely possible you see a successor before a predecessor, which you will incorrectly mark a a back edge.<br class="m_-3196979303694865792gmail_msg">> Please just use a standard DFS approach that is guaranteed correct.<br class="m_-3196979303694865792gmail_msg"><br class="m_-3196979303694865792gmail_msg">This seems super simple and conservative in the sense it will catch all loops.<span class="m_-3196979303694865792Apple-converted-space"> </span></blockquote></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">No actually, it will operate completely inconsistently unless bitcode guarantees an order.</div></div></blockquote><div><br></div></span><div>Order of basic-blocks is guaranteed when round-tripping to bitcode (We really try to avoid relying on other *use-list* though).</div></div></div></blockquote><div><br></div><div>Is it also guaranteed that no matter what order they are produced in by the frontend, they are in the same order once read in?</div><div>Otherwise, this code has the same problem</div></div></div></div>