summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorMax Kazantsev <max.kazantsev@azul.com>2017-10-30 04:48:34 +0000
committerMax Kazantsev <max.kazantsev@azul.com>2017-10-30 04:48:34 +0000
commit1d7c0439b9d4be6b9ad7d167179dc9a75973d056 (patch)
tree4651899c9a3486056e28c0a7db150b4ffe345907 /llvm/lib
parent85bcc297c326e0e9e4e99829256df7d7a8850b94 (diff)
downloadbcm5719-llvm-1d7c0439b9d4be6b9ad7d167179dc9a75973d056.tar.gz
bcm5719-llvm-1d7c0439b9d4be6b9ad7d167179dc9a75973d056.zip
[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
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/GVN.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp
index d7dcfd2eb16..7e416368468 100644
--- a/llvm/lib/Transforms/Scalar/GVN.cpp
+++ b/llvm/lib/Transforms/Scalar/GVN.cpp
@@ -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.
OpenPOWER on IntegriCloud