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

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 29 21:49:07 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL316884: [GVN][NFC] Mark instruction for deletion instead of immediate erasing in LoadPRE (authored by mkazantsev).

Changed prior to commit:
  https://reviews.llvm.org/D39369?vs=120569&id=120767#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D39369

Files:
  llvm/trunk/lib/Transforms/Scalar/GVN.cpp


Index: llvm/trunk/lib/Transforms/Scalar/GVN.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVN.cpp
+++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp
@@ -1167,8 +1167,7 @@
   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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39369.120767.patch
Type: text/x-patch
Size: 572 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171030/9dc3c5be/attachment.bin>


More information about the llvm-commits mailing list