[llvm] r214574 - [SDAG] MorphNodeTo recursively deletes dead operands of the old

Chandler Carruth chandlerc at gmail.com
Fri Aug 1 16:45:29 PDT 2014


I forgot to add in the commit log some further information:

On Fri, Aug 1, 2014 at 3:09 PM, Chandler Carruth <chandlerc at gmail.com>
wrote:

> Author: chandlerc
> Date: Fri Aug  1 17:09:43 2014
> New Revision: 214574
>
> URL: http://llvm.org/viewvc/llvm-project?rev=214574&view=rev
> Log:
> [SDAG] MorphNodeTo recursively deletes dead operands of the old
> fromulation of the node, which isn't really the desired behavior from
> within the combiner or legalizer, but is necessary within ISel. I've
> added a hopefully helpful comment and fixed the only two places where
> this took place.
>
> Yet another step toward the combiner and legalizer not needing to use
> update listeners with virtual calls to manage the worklists behind
> legalization and combining.
>

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.

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140801/e5077bb4/attachment.html>


More information about the llvm-commits mailing list