Skip to content
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