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

llvm-svn: 242417
This commit is contained in:
Benjamin Kramer 2015-07-16 16:51:48 +00:00
parent cd253dae12
commit 5dfd8b6da0
1 changed files with 2 additions and 2 deletions

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.