Skip to content

Commit caf0897

Browse files
authored
[SPIR-V] Fix deprecation warnings after #102608 (#109447)
Follow up to fix warnings in the SPIRV backend after 2f50b28 "[DebugInfo] Enable deprecation of iterator-insertion methods (#102608)"
1 parent ce9a2c6 commit caf0897

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

llvm/lib/Target/SPIRV/SPIRVRegularizer.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ void SPIRVRegularizer::runLowerConstExpr(Function &F) {
127127
ReplList.push_back(Inst);
128128
Repl = InsertElementInst::Create(
129129
(Repl ? Repl : PoisonValue::get(Vec->getType())), V,
130-
ConstantInt::get(Type::getInt32Ty(Ctx), Idx++), "", InsPoint);
130+
ConstantInt::get(Type::getInt32Ty(Ctx), Idx++), "",
131+
InsPoint->getIterator());
131132
}
132133
WorkList.splice(WorkList.begin(), ReplList);
133134
return Repl;
@@ -234,11 +235,12 @@ void SPIRVRegularizer::visitCallScalToVec(CallInst *CI, StringRef MangledName,
234235
// %call = OpExtInst %v2uint %1 s_min %14 %11
235236
auto ConstInt = ConstantInt::get(IntegerType::get(CI->getContext(), 32), 0);
236237
PoisonValue *PVal = PoisonValue::get(Arg0Ty);
237-
Instruction *Inst =
238-
InsertElementInst::Create(PVal, CI->getOperand(1), ConstInt, "", CI);
238+
Instruction *Inst = InsertElementInst::Create(
239+
PVal, CI->getOperand(1), ConstInt, "", CI->getIterator());
239240
ElementCount VecElemCount = cast<VectorType>(Arg0Ty)->getElementCount();
240241
Constant *ConstVec = ConstantVector::getSplat(VecElemCount, ConstInt);
241-
Value *NewVec = new ShuffleVectorInst(Inst, PVal, ConstVec, "", CI);
242+
Value *NewVec =
243+
new ShuffleVectorInst(Inst, PVal, ConstVec, "", CI->getIterator());
242244
CI->setOperand(1, NewVec);
243245
CI->replaceUsesOfWith(OldF, NewF);
244246
CI->mutateFunctionType(NewF->getFunctionType());

llvm/lib/Target/SPIRV/SPIRVStripConvergentIntrinsics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class SPIRVStripConvergentIntrinsics : public FunctionPass {
6262
return;
6363

6464
auto *NewCall = CallBase::removeOperandBundle(
65-
CI, LLVMContext::OB_convergencectrl, CI);
65+
CI, LLVMContext::OB_convergencectrl, CI->getIterator());
6666
NewCall->copyMetadata(*CI);
6767
CI->replaceAllUsesWith(NewCall);
6868
ToRemove.insert(CI);

0 commit comments

Comments
 (0)