<div dir="ltr">(and if you want to differentiate back and cross edges, you either need to track the DFS numbers to see if they are ancestors or walk the entire visitstack) </div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 3, 2016 at 11:34 AM, Daniel Berlin <span dir="ltr"><<a href="mailto:dberlin@dberlin.org" target="_blank">dberlin@dberlin.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>It's not strictly necessary if you restructured the storage  a bit (you can do it with just insert, because any element you go to insert and it already exists means you hit a backedge).  If the insert call took the "from" node as well, you could just mark from->to as a backedge anytime you go to insert it and it's already there.</div><div><br></div><div>If you keep the iterator structured as is, the backedges are the nodes that are visited but not completed when you hit them again (IE i can't see how to do this without modifying insert there too).</div><div><br></div><div>But you have the same problem in keeping track of the from node.</div><div><div class="h5"><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div class="gmail_quote"><div dir="ltr">On Mon, Oct 3, 2016, 11:23 AM Mehdi AMINI <<a href="mailto:mehdi.amini@apple.com" target="_blank">mehdi.amini@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">mehdi_amini added a comment.<br class="m_1265135544033621274m_-3874837697723593355gmail_msg">
<br class="m_1265135544033621274m_-3874837697723593355gmail_msg">
This looks fine to me as well.<br class="m_1265135544033621274m_-3874837697723593355gmail_msg">
(I don't know how you'll figure back-edge with it, but I'll see in the next patch)<br class="m_1265135544033621274m_-3874837697723593355gmail_msg">
<br class="m_1265135544033621274m_-3874837697723593355gmail_msg">
<br class="m_1265135544033621274m_-3874837697723593355gmail_msg">
<a href="https://reviews.llvm.org/D25191" rel="noreferrer" class="m_1265135544033621274m_-3874837697723593355gmail_msg" target="_blank">https://reviews.llvm.org/D2519<wbr>1</a><br class="m_1265135544033621274m_-3874837697723593355gmail_msg">
<br class="m_1265135544033621274m_-3874837697723593355gmail_msg">
<br class="m_1265135544033621274m_-3874837697723593355gmail_msg">
<br class="m_1265135544033621274m_-3874837697723593355gmail_msg">
</blockquote></div></div></div></div>
</blockquote></div><br></div>