[PATCH] D138976: [NFC] Replaces: BB->getInstList().erase(I) with I->eraseFromParent().

Vasileios Porpodas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 29 20:40:42 PST 2022


vporpo created this revision.
vporpo added a reviewer: asbirlea.
Herald added subscribers: laytonio, hiraditya.
Herald added a project: All.
vporpo requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D138976

Files:
  llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp


Index: llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
+++ llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
@@ -716,8 +716,8 @@
   BranchInst *NewBI = BranchInst::Create(HeaderBB, Ret);
   NewBI->setDebugLoc(CI->getDebugLoc());
 
-  BB->getInstList().erase(Ret);  // Remove return.
-  BB->getInstList().erase(CI);   // Remove call.
+  Ret->eraseFromParent();  // Remove return.
+  CI->eraseFromParent();   // Remove call.
   DTU.applyUpdates({{DominatorTree::Insert, BB, HeaderBB}});
   ++NumEliminated;
   return true;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138976.478795.patch
Type: text/x-patch
Size: 663 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221130/10cde3c3/attachment.bin>


More information about the llvm-commits mailing list