@@ -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 ());
0 commit comments