Skip to content

Commit

Permalink
[SPIR-V] Fix deprecation warnings after llvm#102608 (llvm#109447)
Browse files Browse the repository at this point in the history
Follow up to fix warnings in the SPIRV backend after 2f50b28
"[DebugInfo] Enable deprecation of iterator-insertion methods (llvm#102608)"
  • Loading branch information
bogner authored Sep 23, 2024
1 parent ce9a2c6 commit caf0897
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions llvm/lib/Target/SPIRV/SPIRVRegularizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ void SPIRVRegularizer::runLowerConstExpr(Function &F) {
ReplList.push_back(Inst);
Repl = InsertElementInst::Create(
(Repl ? Repl : PoisonValue::get(Vec->getType())), V,
ConstantInt::get(Type::getInt32Ty(Ctx), Idx++), "", InsPoint);
ConstantInt::get(Type::getInt32Ty(Ctx), Idx++), "",
InsPoint->getIterator());
}
WorkList.splice(WorkList.begin(), ReplList);
return Repl;
Expand Down Expand Up @@ -234,11 +235,12 @@ void SPIRVRegularizer::visitCallScalToVec(CallInst *CI, StringRef MangledName,
// %call = OpExtInst %v2uint %1 s_min %14 %11
auto ConstInt = ConstantInt::get(IntegerType::get(CI->getContext(), 32), 0);
PoisonValue *PVal = PoisonValue::get(Arg0Ty);
Instruction *Inst =
InsertElementInst::Create(PVal, CI->getOperand(1), ConstInt, "", CI);
Instruction *Inst = InsertElementInst::Create(
PVal, CI->getOperand(1), ConstInt, "", CI->getIterator());
ElementCount VecElemCount = cast<VectorType>(Arg0Ty)->getElementCount();
Constant *ConstVec = ConstantVector::getSplat(VecElemCount, ConstInt);
Value *NewVec = new ShuffleVectorInst(Inst, PVal, ConstVec, "", CI);
Value *NewVec =
new ShuffleVectorInst(Inst, PVal, ConstVec, "", CI->getIterator());
CI->setOperand(1, NewVec);
CI->replaceUsesOfWith(OldF, NewF);
CI->mutateFunctionType(NewF->getFunctionType());
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/SPIRV/SPIRVStripConvergentIntrinsics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class SPIRVStripConvergentIntrinsics : public FunctionPass {
return;

auto *NewCall = CallBase::removeOperandBundle(
CI, LLVMContext::OB_convergencectrl, CI);
CI, LLVMContext::OB_convergencectrl, CI->getIterator());
NewCall->copyMetadata(*CI);
CI->replaceAllUsesWith(NewCall);
ToRemove.insert(CI);
Expand Down

0 comments on commit caf0897

Please sign in to comment.