[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204538 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Juergen Ributzka 2014-03-22 01:49:30 +00:00
parent 5cfc91c9a5
commit 62f4b48fc1

View File

@ -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.