1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

[GVN][NFC] Mark instruction for deletion instead of immediate erasing in LoadPRE

It is done to uniformly handle instructions removal.

Differential Revision: https://reviews.llvm.org/D39369

llvm-svn: 316884
This commit is contained in:
Max Kazantsev 2017-10-30 04:48:34 +00:00
parent bd4dda833e
commit 9d3ed5c225

View File

@ -1167,8 +1167,7 @@ bool GVN::PerformLoadPRE(LoadInst *LI, AvailValInBlkVect &ValuesPerBlock,
if (!CanDoPRE) {
while (!NewInsts.empty()) {
Instruction *I = NewInsts.pop_back_val();
if (MD) MD->removeInstruction(I);
I->eraseFromParent();
markInstructionForDeletion(I);
}
// HINT: Don't revert the edge-splitting as following transformation may
// also need to split these critical edges.