Skip to content

[SPIR-V] Fix deprecation warnings after #102608 #109447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

bogner
Copy link
Contributor

@bogner bogner commented Sep 20, 2024

Follow up to fix warnings in the SPIRV backend after 2f50b28 "[DebugInfo] Enable deprecation of iterator-insertion methods (#102608)"

Follow up to fix warnings in the SPIRV backend after 2f50b28 "[DebugInfo]
Enable deprecation of iterator-insertion methods (llvm#102608)"
@llvmbot
Copy link
Member

llvmbot commented Sep 20, 2024

@llvm/pr-subscribers-backend-spir-v

Author: Justin Bogner (bogner)

Changes

Follow up to fix warnings in the SPIRV backend after 2f50b28 "[DebugInfo] Enable deprecation of iterator-insertion methods (#102608)"


Full diff: https://github.com/llvm/llvm-project/pull/109447.diff

2 Files Affected:

  • (modified) llvm/lib/Target/SPIRV/SPIRVRegularizer.cpp (+6-4)
  • (modified) llvm/lib/Target/SPIRV/SPIRVStripConvergentIntrinsics.cpp (+1-1)
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<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());
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);

@Keenuts Keenuts merged commit caf0897 into llvm:main Sep 23, 2024
11 checks passed
qiaojbao pushed a commit to GPUOpen-Drivers/llvm-project that referenced this pull request Oct 31, 2024
…3c0b2e9b9

Local branch amd-gfx bd53c0b Merged main:21627236363d629f6a5b820f45a6071371e4b8db into amd-gfx:842efb6db236
Remote branch main caf0897 [SPIR-V] Fix deprecation warnings after llvm#102608 (llvm#109447)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants