[NVPTX] Don't leak dead instructions after unlinking them from the BasicBlock

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242417 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2015-07-16 16:51:48 +00:00
parent 965883ad85
commit fc0d94c8ec

View File

@ -174,7 +174,7 @@ void convertMemMoveToLoop(Instruction *splitAt, Value *srcAddr, Value *dstAddr,
LoopPhi->addIncoming(IndexPtr, LoopBB);
LoopPhi->addIncoming(len, CopyBackwardsBB);
BranchInst::Create(ExitBB, LoopBB, CompareN, ThenTerm);
ThenTerm->removeFromParent();
ThenTerm->eraseFromParent();
// Copying forward.
BasicBlock *FwdLoopBB =
@ -193,7 +193,7 @@ void convertMemMoveToLoop(Instruction *splitAt, Value *srcAddr, Value *dstAddr,
FwdCopyPhi->addIncoming(ConstantInt::get(TypeOfLen, 0), CopyForwardBB);
BranchInst::Create(ExitBB, FwdLoopBB, CompareN, ElseTerm);
ElseTerm->removeFromParent();
ElseTerm->eraseFromParent();
}
// Lower memset to loop.