@@ -499,7 +499,8 @@ CallInst *OCLToSPIRVBase::visitCallAtomicCmpXchg(CallInst *CI) {
499
499
}
500
500
501
501
void OCLToSPIRVBase::visitCallAtomicInit (CallInst *CI) {
502
- auto *ST = new StoreInst (CI->getArgOperand (1 ), CI->getArgOperand (0 ), CI);
502
+ auto *ST = new StoreInst (CI->getArgOperand (1 ), CI->getArgOperand (0 ),
503
+ CI->getIterator ());
503
504
ST->takeName (CI);
504
505
CI->dropAllReferences ();
505
506
CI->eraseFromParent ();
@@ -515,11 +516,11 @@ void OCLToSPIRVBase::visitCallAllAny(spv::Op OC, CallInst *CI) {
515
516
auto *Zero = Constant::getNullValue (Args[0 ]->getType ());
516
517
517
518
auto *Cmp = CmpInst::Create (CmpInst::ICmp, CmpInst::ICMP_SLT, Args[0 ], Zero,
518
- " cast" , CI);
519
+ " cast" , CI-> getIterator () );
519
520
520
521
if (!isa<VectorType>(ArgTy)) {
521
- auto *Cast = CastInst::CreateZExtOrBitCast (Cmp, Type::getInt32Ty (*Ctx), " " ,
522
- Cmp->getNextNode ());
522
+ auto *Cast = CastInst::CreateZExtOrBitCast (
523
+ Cmp, Type::getInt32Ty (*Ctx), " " , Cmp->getNextNode ()-> getIterator ());
523
524
CI->replaceAllUsesWith (Cast);
524
525
CI->eraseFromParent ();
525
526
} else {
@@ -1040,13 +1041,15 @@ void OCLToSPIRVBase::visitCallGetImageSize(CallInst *CI,
1040
1041
Constant *Index[] = {getInt32 (M, 0 ), getInt32 (M, 1 ), getInt32 (M, 2 ),
1041
1042
getInt32 (M, 3 )};
1042
1043
return new ShuffleVectorInst (NCI, ZeroVec,
1043
- ConstantVector::get (Index), " " , CI);
1044
+ ConstantVector::get (Index), " " ,
1045
+ CI->getIterator ());
1044
1046
1045
1047
} else if (Desc.Dim == Dim2D && Desc.Arrayed ) {
1046
1048
Constant *Index[] = {getInt32 (M, 0 ), getInt32 (M, 1 )};
1047
1049
Constant *Mask = ConstantVector::get (Index);
1048
1050
return new ShuffleVectorInst (NCI, UndefValue::get (NCI->getType ()),
1049
- Mask, NCI->getName (), CI);
1051
+ Mask, NCI->getName (),
1052
+ CI->getIterator ());
1050
1053
}
1051
1054
return NCI;
1052
1055
}
@@ -1056,7 +1059,7 @@ void OCLToSPIRVBase::visitCallGetImageSize(CallInst *CI,
1056
1059
.Case (kOCLBuiltinName ::GetImageDepth, 2 )
1057
1060
.Case (kOCLBuiltinName ::GetImageArraySize, Dim - 1 );
1058
1061
return ExtractElementInst::Create (NCI, getUInt32 (M, I), " " ,
1059
- NCI->getNextNode ());
1062
+ NCI->getNextNode ()-> getIterator () );
1060
1063
});
1061
1064
}
1062
1065
@@ -1371,11 +1374,12 @@ void OCLToSPIRVBase::visitCallScalToVec(CallInst *CI, StringRef MangledName,
1371
1374
getExtOp (MangledName, DemangledName)));
1372
1375
for (auto I : ScalarPos)
1373
1376
Mutator.mapArg (I, [&](Value *V) {
1374
- Instruction *Inst = InsertElementInst::Create (UndefValue::get (VecTy), V,
1375
- getInt32 (M, 0 ), " " , CI);
1377
+ Instruction *Inst = InsertElementInst::Create (
1378
+ UndefValue::get (VecTy), V, getInt32 (M, 0 ), " " , CI-> getIterator () );
1376
1379
return new ShuffleVectorInst (
1377
1380
Inst, UndefValue::get (VecTy),
1378
- ConstantVector::getSplat (VecElemCount, getInt32 (M, 0 )), " " , CI);
1381
+ ConstantVector::getSplat (VecElemCount, getInt32 (M, 0 )), " " ,
1382
+ CI->getIterator ());
1379
1383
});
1380
1384
}
1381
1385
@@ -1488,7 +1492,7 @@ void OCLToSPIRVBase::visitCallEnqueueKernel(CallInst *CI,
1488
1492
LocalSizeArray->getSourceElementType (), // Pointee type
1489
1493
LocalSizeArray->getPointerOperand (), // Alloca
1490
1494
{getInt32 (M, 0 ), getInt32 (M, I)}, // Indices
1491
- " " , CI));
1495
+ " " , CI-> getIterator () ));
1492
1496
}
1493
1497
1494
1498
StringRef NewName = " __spirv_EnqueueKernel__" ;
@@ -1497,7 +1501,7 @@ void OCLToSPIRVBase::visitCallEnqueueKernel(CallInst *CI,
1497
1501
Function *NewF =
1498
1502
Function::Create (FT, GlobalValue::ExternalLinkage, NewName, M);
1499
1503
NewF->setCallingConv (CallingConv::SPIR_FUNC);
1500
- CallInst *NewCall = CallInst::Create (NewF, Args, " " , CI);
1504
+ CallInst *NewCall = CallInst::Create (NewF, Args, " " , CI-> getIterator () );
1501
1505
NewCall->setCallingConv (NewF->getCallingConv ());
1502
1506
CI->replaceAllUsesWith (NewCall);
1503
1507
CI->eraseFromParent ();
0 commit comments