[PATCH] D139153: [NFC] Remove the instruction list from the arguments of llvm::ReplaceInstWithValue().
Vasileios Porpodas via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 12 17:51:35 PST 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGda49083dbf0f: [NFC] Remove the instruction list from the arguments of llvm… (authored by vporpo).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D139153/new/
https://reviews.llvm.org/D139153
Files:
llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h
llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
Index: llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
===================================================================
--- llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
+++ llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
@@ -541,8 +541,7 @@
return MadeChanges;
}
-void llvm::ReplaceInstWithValue(BasicBlock::InstListType &BIL,
- BasicBlock::iterator &BI, Value *V) {
+void llvm::ReplaceInstWithValue(BasicBlock::iterator &BI, Value *V) {
Instruction &I = *BI;
// Replaces all of the uses of the instruction with uses of the value
I.replaceAllUsesWith(V);
@@ -552,7 +551,7 @@
V->takeName(&I);
// Delete the unnecessary instruction now...
- BI = BIL.erase(BI);
+ BI = BI->eraseFromParent();
}
void llvm::ReplaceInstWithInst(BasicBlock *BB, BasicBlock::iterator &BI,
@@ -569,7 +568,7 @@
BasicBlock::iterator New = I->insertAt(BB, BI);
// Replace all uses of the old instruction, and delete it.
- ReplaceInstWithValue(BB->getInstList(), BI, I);
+ ReplaceInstWithValue(BI, I);
// Move BI back to point to the newly inserted instruction
BI = New;
Index: llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h
===================================================================
--- llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h
+++ llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h
@@ -114,8 +114,7 @@
/// Replace all uses of an instruction (specified by BI) with a value, then
/// remove and delete the original instruction.
-void ReplaceInstWithValue(BasicBlock::InstListType &BIL,
- BasicBlock::iterator &BI, Value *V);
+void ReplaceInstWithValue(BasicBlock::iterator &BI, Value *V);
/// Replace the instruction specified by BI with the instruction specified by I.
/// Copies DebugLoc from BI to I, if I doesn't already have a DebugLoc. The
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139153.482326.patch
Type: text/x-patch
Size: 1858 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221213/0f78ab44/attachment.bin>
More information about the llvm-commits
mailing list