From: Dan Gohman Date: Mon, 21 Jul 2008 21:04:07 +0000 (+0000) Subject: After early-lowering the FORMAL_ARGUMENTS node, delete it. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=2dbc167294c1a7a4cd7a43f86bff104afd6110e5;p=oota-llvm.git After early-lowering the FORMAL_ARGUMENTS node, delete it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53874 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index b500b6ab6b3..12c54c1eeff 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -4686,6 +4686,13 @@ void TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG, (Result->getNumValues()+1 == TmpRes.Val->getNumValues() && TmpRes.getValue(Result->getNumValues()).getValueType() == MVT::Flag)) && "Lowering produced unexpected number of results!"); + + // The FORMAL_ARGUMENTS node itself is likely no longer needed. + if (Result != TmpRes.Val && Result->use_empty()) { + HandleSDNode Dummy(DAG.getRoot()); + DAG.RemoveDeadNode(Result); + } + Result = TmpRes.Val; unsigned NumArgRegs = Result->getNumValues() - 1;