[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
Fri Oct 27 04:00:59 PDT 2017


mkazantsev created this revision.

It is done to uniformly handle instructions removal.


https://reviews.llvm.org/D39369

Files:
  lib/Transforms/Scalar/GVN.cpp


Index: lib/Transforms/Scalar/GVN.cpp
===================================================================
--- lib/Transforms/Scalar/GVN.cpp
+++ 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.120569.patch
Type: text/x-patch
Size: 539 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171027/2cbd0bfa/attachment.bin>


More information about the llvm-commits mailing list