1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 11:33:24 +02:00

[NFC] Remove meaningless code from GVN

llvm-svn: 342202
This commit is contained in:
Max Kazantsev 2018-09-14 04:50:38 +00:00
parent 5053e93d46
commit 79083b107c

View File

@ -2073,18 +2073,12 @@ bool GVN::processBlock(BasicBlock *BB) {
if (!AtStart)
--BI;
const Instruction *MaybeFirstICF = ICF->getFirstICFI(BB);
for (auto *I : InstrsToErase) {
assert(I->getParent() == BB && "Removing instruction from wrong block?");
LLVM_DEBUG(dbgs() << "GVN removed: " << *I << '\n');
salvageDebugInfo(*I);
if (MD) MD->removeInstruction(I);
LLVM_DEBUG(verifyRemoved(I));
if (MaybeFirstICF == I) {
// We have erased the first ICF in block. The map needs to be updated.
// Do not keep dangling pointer on the erased instruction.
MaybeFirstICF = nullptr;
}
I->eraseFromParent();
}