[llvm] r204538 - [Constant Hoisting] Erase dead cast instructions.

Juergen Ributzka juergen at apple.com
Fri Mar 21 18:49:30 PDT 2014


Author: ributzka
Date: Fri Mar 21 20:49:30 2014
New Revision: 204538

URL: http://llvm.org/viewvc/llvm-project?rev=204538&view=rev
Log:
[Constant Hoisting] Erase dead cast instructions.

The cleanup code that removes dead cast instructions only removed them from the
basic block, but didn't delete them. This fix erases them now too.

Modified:
    llvm/trunk/lib/Transforms/Scalar/ConstantHoisting.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/ConstantHoisting.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ConstantHoisting.cpp?rev=204538&r1=204537&r2=204538&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/ConstantHoisting.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/ConstantHoisting.cpp Fri Mar 21 20:49:30 2014
@@ -595,7 +595,7 @@ bool ConstantHoisting::emitBaseConstants
 void ConstantHoisting::deleteDeadCastInst() const {
   for (auto const &I : ClonedCastMap)
     if (I.first->use_empty())
-      I.first->removeFromParent();
+      I.first->eraseFromParent();
 }
 
 /// \brief Optimize expensive integer constants in the given function.





More information about the llvm-commits mailing list