[llvm] 4c5469e - [NFC] Replaces: BB->getInstList().erase(I) with I->eraseFromParent().
Vasileios Porpodas via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 12 16:23:27 PST 2022
Author: Vasileios Porpodas
Date: 2022-12-12T16:22:12-08:00
New Revision: 4c5469e2c0c5f9d1410e0dae61a5bb068c720e2b
URL: https://github.com/llvm/llvm-project/commit/4c5469e2c0c5f9d1410e0dae61a5bb068c720e2b
DIFF: https://github.com/llvm/llvm-project/commit/4c5469e2c0c5f9d1410e0dae61a5bb068c720e2b.diff
LOG: [NFC] Replaces: BB->getInstList().erase(I) with I->eraseFromParent().
Differential Revision: https://reviews.llvm.org/D138976
Added:
Modified:
llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp b/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
index ad90c961267c..4f1350e4ebb9 100644
--- a/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
@@ -716,8 +716,8 @@ bool TailRecursionEliminator::eliminateCall(CallInst *CI) {
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;
More information about the llvm-commits
mailing list