From d61e28d3ecd580d902e406b4548e711277dedf27 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sat, 2 Aug 2014 00:24:54 +0000 Subject: [PATCH] [SDAG] Allow the legalizer to delete an illegally typed intermediate introduced during legalization. This pattern is based on other patterns in the legalizer that I changed in the same way. Now, the legalizer eagerly collects its garbage when necessary so that we can survive leaving such nodes around for it. Instead, we add an assert to make sure the node will be correctly handled by that layer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214602 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/Sparc/SparcISelLowering.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Target/Sparc/SparcISelLowering.cpp b/lib/Target/Sparc/SparcISelLowering.cpp index 4d9f957bc3b..55eb1ea2aaa 100644 --- a/lib/Target/Sparc/SparcISelLowering.cpp +++ b/lib/Target/Sparc/SparcISelLowering.cpp @@ -2754,9 +2754,10 @@ static SDValue LowerUMULO_SMULO(SDValue Op, SelectionDAG &DAG, ISD::SETNE); } // MulResult is a node with an illegal type. Because such things are not - // generally permitted during this phase of legalization, delete the - // node. The above EXTRACT_ELEMENT nodes should have been folded. - DAG.DeleteNode(MulResult.getNode()); + // generally permitted during this phase of legalization, ensure that + // nothing is left using the node. The above EXTRACT_ELEMENT nodes should have + // been folded. + assert(MulResult->use_empty() && "Illegally typed node still in use!"); SDValue Ops[2] = { BottomHalf, TopHalf } ; return DAG.getMergeValues(Ops, dl); -- 2.34.1