<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 1, 2016, at 1:36 PM, Daniel Berlin <<a href="mailto:dberlin@dberlin.org" class="">dberlin@dberlin.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><br class="Apple-interchange-newline"><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On Sat, Oct 1, 2016 at 9:25 AM, Mehdi Amini<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:mehdi.amini@apple.com" target="_blank" class="">mehdi.amini@apple.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><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;"><div style="word-wrap: break-word;" class=""><br class=""><div class=""><span class=""><blockquote type="cite" class=""><div class="">On Oct 1, 2016, at 9:22 AM, Daniel Berlin <<a href="mailto:dberlin@dberlin.org" target="_blank" class="">dberlin@dberlin.org</a>> wrote:</div><br class="m_-3196979303694865792Apple-interchange-newline"><div class=""><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;" class=""><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;" class=""><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" class="">On Sat, Oct 1, 2016, 9:36 AM David Callahan <<a href="mailto:dcallahan@fb.com" target="_blank" class="">dcallahan@fb.com</a>> wrote:<br class=""></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;" class=""><br class=""></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;" class=""><br class=""></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;" class="">No actually, it will operate completely inconsistently unless bitcode guarantees an order.</div></div></blockquote><div class=""><br class=""></div></span><div class="">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 class=""><br class=""></div><div class="">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></div></blockquote><div><br class=""></div>No: the frontend decide the initial order, LLVM has no guarantee over this order, and transformations are free to reorder at will, I was just clarifying the bitcode state: round-trip won’t change the order.</div><div class=""><br class=""></div><div class="">— </div><div class="">Mehdi</div><div class=""><br class=""></div></body></html>