summaryrefslogtreecommitdiff
path: root/llvm/lib/Target/SPIRV/SPIRVRegularizer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/SPIRV/SPIRVRegularizer.cpp')
-rw-r--r--llvm/lib/Target/SPIRV/SPIRVRegularizer.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Target/SPIRV/SPIRVRegularizer.cpp b/llvm/lib/Target/SPIRV/SPIRVRegularizer.cpp
index 322e051a87db..246eecd4ffca 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());