OSDN Git Service

SDAG: Clean up a dangling node in SparcISelDAGToDAG::SelectImpl
authorJustin Bogner <mail@justinbogner.com>
Fri, 13 May 2016 06:37:53 +0000 (06:37 +0000)
committerJustin Bogner <mail@justinbogner.com>
Fri, 13 May 2016 06:37:53 +0000 (06:37 +0000)
When we convert to the void Select interface, leaving unreferenced
nodes around won't be allowed anymore.

Part of llvm.org/pr26808.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269396 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Sparc/SparcISelDAGToDAG.cpp

index 990f101..cd4603e 100644 (file)
@@ -372,6 +372,7 @@ SDNode *SparcDAGToDAGISel::SelectImpl(SDNode *N) {
         CurDAG->getMachineNode(Opcode, dl, MVT::i32, MVT::i32, MulLHS, MulRHS);
     SDValue ResultHigh = SDValue(Mul, 1);
     ReplaceUses(SDValue(N, 0), ResultHigh);
+    CurDAG->RemoveDeadNode(N);
     return nullptr;
   }
   }