[SDAG] Allow the legalizer to delete an illegally typed intermediate
authorChandler Carruth <chandlerc@gmail.com>
Sat, 2 Aug 2014 00:24:54 +0000 (00:24 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sat, 2 Aug 2014 00:24:54 +0000 (00:24 +0000)
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

index 4d9f957bc3b922ceb27ec3488b264dc30bd1327b..55eb1ea2aaa634c2d5d2084ac09f435b385183bf 100644 (file)
@@ -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);