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

Benjamin Kramer benny.kra at googlemail.com
Thu Jul 16 09:51:48 PDT 2015


Author: d0k
Date: Thu Jul 16 11:51:48 2015
New Revision: 242417

URL: http://llvm.org/viewvc/llvm-project?rev=242417&view=rev
Log:
[NVPTX] Don't leak dead instructions after unlinking them from the BasicBlock

Modified:
    llvm/trunk/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp

Modified: llvm/trunk/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp?rev=242417&r1=242416&r2=242417&view=diff
==============================================================================
--- llvm/trunk/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp (original)
+++ llvm/trunk/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp Thu Jul 16 11:51:48 2015
@@ -174,7 +174,7 @@ void convertMemMoveToLoop(Instruction *s
   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 *s
   FwdCopyPhi->addIncoming(ConstantInt::get(TypeOfLen, 0), CopyForwardBB);
 
   BranchInst::Create(ExitBB, FwdLoopBB, CompareN, ElseTerm);
-  ElseTerm->removeFromParent();
+  ElseTerm->eraseFromParent();
 }
 
 // Lower memset to loop.





More information about the llvm-commits mailing list