forked from OSchip/llvm-project
[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. llvm-svn: 204538
This commit is contained in:
parent
e802d507b0
commit
e474752f4c
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue