From: Chris Lattner Date: Tue, 2 Mar 2010 07:14:49 +0000 (+0000) Subject: I was confused about this, it turns out that MorphNodeTo X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=61c97f693216670cda554d287cd871fdea1b36f9;p=oota-llvm.git I was confused about this, it turns out that MorphNodeTo *does* delete ex-operands that become dead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97559 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index f708ff25832..7e1ce429ef7 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -1770,9 +1770,8 @@ MorphNode(SDNode *Node, unsigned TargetOpc, SDVTList VTList, } else if (Node->getValueType(NTMNumResults-1) == MVT::Other) OldChainResultNo = NTMNumResults-1; - // FIXME: If this matches multiple nodes it will just leave them here - // dead with noone to love them. These dead nodes can block future - // matches (!). + // Call the underlying SelectionDAG routine to do the transmogrification. Note + // that this deletes operands of the old node that become dead. SDNode *Res = CurDAG->MorphNodeTo(Node, ~TargetOpc, VTList, Ops, NumOps); // MorphNodeTo can operate in two ways: if an existing node with the