summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-07-21 21:04:07 +0000
committerDan Gohman <gohman@apple.com>2008-07-21 21:04:07 +0000
commit2dbc167294c1a7a4cd7a43f86bff104afd6110e5 (patch)
tree4cd7e0b19786bd8068bdfa292e0a52ec48081e36 /lib
parenta022bdfd99bc092dac9cefb4c2be9de787ea8e0f (diff)
downloadllvm-2dbc167294c1a7a4cd7a43f86bff104afd6110e5.tar.gz
llvm-2dbc167294c1a7a4cd7a43f86bff104afd6110e5.tar.bz2
llvm-2dbc167294c1a7a4cd7a43f86bff104afd6110e5.tar.xz
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
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index b500b6ab6b..12c54c1eef 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;