<div dir="ltr"><div>This is a little hard to diagnose in the abstract, but it sounds like you're having a loop along the lines of visit A -> visit B/C -> visit D -> visit A and that at each step you're making a real reasonable change to the DAG and returning to the original DAG. <br></div><div><br></div><div>One possible solution is to to rework the optimization to occur when visiting A not D. so the last edge in the visit loop no longer happens. <br></div><div><br></div><div>If that's not feasible, I don't think there's much you can do that is not effectively preventing one of those transitions from occurring when it would cause the infinite visit loop.</div><div><br></div><div>HTH,</div><div><br></div><div>-Nirav</div><div><br></div><div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 22, 2017 at 2:21 AM, Amaury SECHET via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.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><div><div><div><div><span style="font-family:monospace,monospace">I'm trying to optimize a pattern that goes roughly as:<br></span></div><span style="font-family:monospace,monospace"> A<br> / \<br></span></div><span style="font-family:monospace,monospace"> B C<br> \ /<br></span></div><span style="font-family:monospace,monospace"> D<br><br></span></div><span style="font-family:monospace,monospace">Problem is, when A gets modified, B and C get added back to the worklist, but D doesn't. Readding D to the worklist just create an infinite loop where one process D again and again.<br><br></span></div><span style="font-family:monospace,monospace">Is there a proper way to make this work ?<br></span></div>
<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>