Skip to content

[NFC][DebugInfo] Mop up final instruction-insertion call sites #124289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/lib/SandboxIR/Instruction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void Instruction::insertBefore(Instruction *BeforeI) {

// Insert the LLVM IR Instructions in program order.
for (llvm::Instruction *I : getLLVMInstrs())
I->insertBefore(BeforeTopI);
I->insertBefore(BeforeTopI->getIterator());
}

void Instruction::insertAfter(Instruction *AfterI) {
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/SandboxIR/Tracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ void EraseFromParent::revert(Tracker &Tracker) {
// Place the bottom-most instruction first.
auto [Operands, BotLLVMI] = InstrData[0];
if (auto *NextLLVMI = dyn_cast<llvm::Instruction *>(NextLLVMIOrBB)) {
BotLLVMI->insertBefore(NextLLVMI);
BotLLVMI->insertBefore(NextLLVMI->getIterator());
} else {
auto *LLVMBB = cast<llvm::BasicBlock *>(NextLLVMIOrBB);
BotLLVMI->insertInto(LLVMBB, LLVMBB->end());
Expand All @@ -185,7 +185,7 @@ void EraseFromParent::revert(Tracker &Tracker) {

// Go over the rest of the instructions and stack them on top.
for (auto [Operands, LLVMI] : drop_begin(InstrData)) {
LLVMI->insertBefore(BotLLVMI);
LLVMI->insertBefore(BotLLVMI->getIterator());
for (auto [OpNum, Op] : enumerate(Operands))
LLVMI->setOperand(OpNum, Op);
BotLLVMI = LLVMI;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3828,7 +3828,7 @@ handleDeclareTargetMapVar(MapInfoData &mapData,
if (insn->getFunction() == func) {
auto *load = builder.CreateLoad(mapData.BasePointers[i]->getType(),
mapData.BasePointers[i]);
load->moveBefore(insn);
load->moveBefore(insn->getIterator());
user->replaceUsesOfWith(mapData.OriginalValue[i], load);
}
}
Expand Down
Loading