From caf0897c9c7f6f2a142af06bff8680a23d1d4bf5 Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Mon, 23 Sep 2024 09:16:09 -0700 Subject: [PATCH] [SPIR-V] Fix deprecation warnings after #102608 (#109447) Follow up to fix warnings in the SPIRV backend after 2f50b280dc8e "[DebugInfo] Enable deprecation of iterator-insertion methods (#102608)" --- llvm/lib/Target/SPIRV/SPIRVRegularizer.cpp | 10 ++++++---- .../Target/SPIRV/SPIRVStripConvergentIntrinsics.cpp | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/llvm/lib/Target/SPIRV/SPIRVRegularizer.cpp b/llvm/lib/Target/SPIRV/SPIRVRegularizer.cpp index 322e051a87db1a..246eecd4ffcaa1 100644 --- a/llvm/lib/Target/SPIRV/SPIRVRegularizer.cpp +++ b/llvm/lib/Target/SPIRV/SPIRVRegularizer.cpp @@ -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; @@ -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(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()); diff --git a/llvm/lib/Target/SPIRV/SPIRVStripConvergentIntrinsics.cpp b/llvm/lib/Target/SPIRV/SPIRVStripConvergentIntrinsics.cpp index b632d784977678..c87048b93f80fc 100644 --- a/llvm/lib/Target/SPIRV/SPIRVStripConvergentIntrinsics.cpp +++ b/llvm/lib/Target/SPIRV/SPIRVStripConvergentIntrinsics.cpp @@ -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);