forked from OSchip/llvm-project
[NVPTX] Don't leak dead instructions after unlinking them from the BasicBlock
llvm-svn: 242417
This commit is contained in:
parent
cd253dae12
commit
5dfd8b6da0
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue