[SDAG] MorphNodeTo recursively deletes dead operands of the old
[oota-llvm.git] / lib / Target / R600 / SIISelLowering.cpp
index dc26a82e19d1521a359561130ea2e92a1baf2525..36afe5792a3f09ee91605560348bf5b7f3b3418a 100644 (file)
@@ -774,7 +774,9 @@ SDValue SITargetLowering::LowerBRCOND(SDValue BRCOND,
       BR->getOperand(0),
       BRCOND.getOperand(2)
     };
-    DAG.MorphNodeTo(BR, ISD::BR, BR->getVTList(), Ops);
+    SDValue NewBR = DAG.getNode(ISD::BR, DL, BR->getVTList(), Ops);
+    DAG.ReplaceAllUsesWith(BR, NewBR.getNode());
+    BR = NewBR.getNode();
   }
 
   SDValue Chain = SDValue(Result, Result->getNumValues() - 1);