<div dir="ltr">I forgot to add in the commit log some further information:<div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 1, 2014 at 3:09 PM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@gmail.com" target="_blank">chandlerc@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: chandlerc<br>
Date: Fri Aug  1 17:09:43 2014<br>
New Revision: 214574<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=214574&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=214574&view=rev</a><br>
Log:<br>
[SDAG] MorphNodeTo recursively deletes dead operands of the old<br>
fromulation of the node, which isn't really the desired behavior from<br>
within the combiner or legalizer, but is necessary within ISel. I've<br>
added a hopefully helpful comment and fixed the only two places where<br>
this took place.<br>
<br>
Yet another step toward the combiner and legalizer not needing to use<br>
update listeners with virtual calls to manage the worklists behind<br>
legalization and combining.<br></blockquote><div><br></div><div>If anyone really wants to return to using MorphNodeTo safely in the combiner or legalizer, it should be straightforward to do so. There is only one real user of MorphNodeTo after this commit, and that is the SDAG instruction selector. That code relies on MorphNodeTo recursively deleting dead operands but could likely be changed easily to delete these nodes itself. Then the deletion logic in MorphNodeTo could be removed, and it would again be safe to use anywhere.</div>
<div><br></div><div>I didn't do this because it was used *so* rarely. I suspect we should actually remove it entirely, or make it a helper local to the ISel part of the SDAG unless someone is hugely motivated to rework most of the SDAG to use MorphToNode and reduce allocation traffic. I don't see that happening any time soon though. And if it waits too long, maybe the SDAG will actually just go away instead.</div>
<div><br></div></div></div></div>