From 5dfd8b6da0ff390c3c970d29e5395d3e65ec9864 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Thu, 16 Jul 2015 16:51:48 +0000 Subject: [PATCH] [NVPTX] Don't leak dead instructions after unlinking them from the BasicBlock llvm-svn: 242417 --- llvm/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp b/llvm/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp index ed758e8d1069..54be21d40831 100644 --- a/llvm/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp +++ b/llvm/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp @@ -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.