aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/XCore
diff options
context:
space:
mode:
authorStephen Tozer <stephen.tozer@sony.com>2024-03-19 15:09:24 +0000
committerStephen Tozer <stephen.tozer@sony.com>2024-03-19 15:49:10 +0000
commit9a96fb4445f4e9d9a7899189758ee6afbeb6510b (patch)
tree7f1b7bb76fcdb50d343adb726890df46473a8222 /llvm/lib/Target/XCore
parent25bb7436ca3edbb0f49cef96a27f1e507b973e6c (diff)
downloadllvm-9a96fb4445f4e9d9a7899189758ee6afbeb6510b.zip
llvm-9a96fb4445f4e9d9a7899189758ee6afbeb6510b.tar.gz
llvm-9a96fb4445f4e9d9a7899189758ee6afbeb6510b.tar.bz2
Reapply "[NFC][RemoveDIs] Switch ConstantExpr::getAsInstruction to not insert (#84737)"
Fixes a build error caused by an unupdated getAsInstruction callsite in clang. This reverts commit ab851f7fe946e7eed700ef9d82082eb721860189.
Diffstat (limited to 'llvm/lib/Target/XCore')
-rw-r--r--llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp b/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp
index b5a683d..5e91cce 100644
--- a/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp
+++ b/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp
@@ -88,12 +88,15 @@ static bool replaceConstantExprOp(ConstantExpr *CE, Pass *P) {
BasicBlock *PredBB = PN->getIncomingBlock(I);
if (PredBB->getTerminator()->getNumSuccessors() > 1)
PredBB = SplitEdge(PredBB, PN->getParent());
- Instruction *InsertPos = PredBB->getTerminator();
- Instruction *NewInst = CE->getAsInstruction(InsertPos);
+ BasicBlock::iterator InsertPos =
+ PredBB->getTerminator()->getIterator();
+ Instruction *NewInst = CE->getAsInstruction();
+ NewInst->insertBefore(*PredBB, InsertPos);
PN->setOperand(I, NewInst);
}
} else if (Instruction *Instr = dyn_cast<Instruction>(WU)) {
- Instruction *NewInst = CE->getAsInstruction(Instr);
+ Instruction *NewInst = CE->getAsInstruction();
+ NewInst->insertBefore(*Instr->getParent(), Instr->getIterator());
Instr->replaceUsesOfWith(CE, NewInst);
} else {
ConstantExpr *CExpr = dyn_cast<ConstantExpr>(WU);