<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><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_-3874837697723593355gmail_msg">
<br class="m_-3874837697723593355gmail_msg">
This looks fine to me as well.<br class="m_-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_-3874837697723593355gmail_msg">
<br class="m_-3874837697723593355gmail_msg">
<br class="m_-3874837697723593355gmail_msg">
<a href="https://reviews.llvm.org/D25191" rel="noreferrer" class="m_-3874837697723593355gmail_msg" target="_blank">https://reviews.llvm.org/<wbr>D25191</a><br class="m_-3874837697723593355gmail_msg">
<br class="m_-3874837697723593355gmail_msg">
<br class="m_-3874837697723593355gmail_msg">
<br class="m_-3874837697723593355gmail_msg">
</blockquote></div></div>