aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
diff options
context:
space:
mode:
authorVasileios Porpodas <vporpodas@google.com>2022-11-28 14:43:11 -0800
committerVasileios Porpodas <vporpodas@google.com>2022-12-12 13:33:05 -0800
commit06911ba6ea1e552d3bcaed2728c92a9aa6cbf4d2 (patch)
treebf4f7cf10a99e47d1867a88bb794c13f986b54c3 /llvm/lib/Transforms/Utils/SimplifyCFG.cpp
parent816b5e546c6553afd463f9630b248a17702700c9 (diff)
downloadllvm-06911ba6ea1e552d3bcaed2728c92a9aa6cbf4d2.zip
llvm-06911ba6ea1e552d3bcaed2728c92a9aa6cbf4d2.tar.gz
llvm-06911ba6ea1e552d3bcaed2728c92a9aa6cbf4d2.tar.bz2
[NFC] Cleanup: Replaces BB->getInstList().insert() with I->insertAt().
This is part of a series of cleanup patches towards making BasicBlock::getInstList() private. Differential Revision: https://reviews.llvm.org/D138877
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/SimplifyCFG.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
index 57954bc..7277c73 100644
--- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -1129,7 +1129,7 @@ static void CloneInstructionsIntoPredecessorBlockAndUpdateSSAUses(
NewBonusInst->dropUndefImplyingAttrsAndUnknownMetadata(
LLVMContext::MD_annotation);
- PredBlock->getInstList().insert(PTI->getIterator(), NewBonusInst);
+ NewBonusInst->insertAt(PredBlock, PTI->getIterator());
NewBonusInst->takeName(&BonusInst);
BonusInst.setName(NewBonusInst->getName() + ".old");
@@ -1694,7 +1694,7 @@ HoistTerminator:
// Okay, it is safe to hoist the terminator.
Instruction *NT = I1->clone();
- BIParent->getInstList().insert(BI->getIterator(), NT);
+ NT->insertAt(BIParent, BI->getIterator());
if (!NT->getType()->isVoidTy()) {
I1->replaceAllUsesWith(NT);
I2->replaceAllUsesWith(NT);
@@ -2498,7 +2498,7 @@ static void MergeCompatibleInvokesImpl(ArrayRef<InvokeInst *> Invokes,
auto *MergedInvoke = cast<InvokeInst>(II0->clone());
// NOTE: all invokes have the same attributes, so no handling needed.
- MergedInvokeBB->getInstList().push_back(MergedInvoke);
+ MergedInvoke->insertAt(MergedInvokeBB, MergedInvokeBB->end());
if (!HasNormalDest) {
// This set does not have a normal destination,
@@ -3245,7 +3245,7 @@ FoldCondBranchOnValueKnownInPredecessorImpl(BranchInst *BI, DomTreeUpdater *DTU,
}
if (N) {
// Insert the new instruction into its new home.
- EdgeBB->getInstList().insert(InsertPt, N);
+ N->insertAt(EdgeBB, InsertPt);
// Register the new instruction with the assumption cache if necessary.
if (auto *Assume = dyn_cast<AssumeInst>(N))