Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

Commit e78fad8

Browse files
author
Max Kazantsev
committed
[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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316884 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent e785b6b commit e78fad8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/Transforms/Scalar/GVN.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,8 +1167,7 @@ bool GVN::PerformLoadPRE(LoadInst *LI, AvailValInBlkVect &ValuesPerBlock,
11671167
if (!CanDoPRE) {
11681168
while (!NewInsts.empty()) {
11691169
Instruction *I = NewInsts.pop_back_val();
1170-
if (MD) MD->removeInstruction(I);
1171-
I->eraseFromParent();
1170+
markInstructionForDeletion(I);
11721171
}
11731172
// HINT: Don't revert the edge-splitting as following transformation may
11741173
// also need to split these critical edges.

0 commit comments

Comments
 (0)