Lines Matching refs:CI
73 void visitCallInst(CallInst &CI);
79 void visitCastInst(CastInst &CI);
85 void visitCallSPRIVImageQuerySize(CallInst *CI);
90 void visitCallSPIRVAtomicBuiltin(CallInst *CI, Op OC);
107 void visitCallSPIRVGroupBuiltin(CallInst *CI, Op OC);
112 void visitCallSPIRVMemoryBarrier(CallInst *CI);
115 void visitCallSPIRVPipeBuiltin(CallInst *CI, Op OC);
119 void visitCallSPIRVBuiltin(CallInst *CI, Op OC);
128 std::string getGroupBuiltinPrefix(CallInst *CI);
159 SPIRVToOCL20::visitCallInst(CallInst& CI) { in visitCallInst() argument
160 DEBUG(dbgs() << "[visistCallInst] " << CI << '\n'); in visitCallInst()
161 auto F = CI.getCalledFunction(); in visitCallInst()
175 visitCallSPRIVImageQuerySize(&CI); in visitCallInst()
179 visitCallSPIRVMemoryBarrier(&CI); in visitCallInst()
183 visitCallSPIRVAtomicBuiltin(&CI, OC); in visitCallInst()
187 visitCallSPIRVGroupBuiltin(&CI, OC); in visitCallInst()
191 visitCallSPIRVPipeBuiltin(&CI, OC); in visitCallInst()
195 visitCallSPIRVBuiltin(&CI, OC); in visitCallInst()
199 void SPIRVToOCL20::visitCallSPIRVMemoryBarrier(CallInst* CI) { in visitCallSPIRVMemoryBarrier() argument
200 AttributeSet Attrs = CI->getCalledFunction()->getAttributes(); in visitCallSPIRVMemoryBarrier()
201 mutateCallInstOCL(M, CI, [=](CallInst *, std::vector<Value *> &Args){ in visitCallSPIRVMemoryBarrier()
215 void SPIRVToOCL20::visitCallSPRIVImageQuerySize(CallInst *CI) { in visitCallSPRIVImageQuerySize() argument
216 Function * func = CI->getCalledFunction(); in visitCallSPRIVImageQuerySize()
241 AttributeSet attributes = CI->getCalledFunction()->getAttributes(); in visitCallSPRIVImageQuerySize()
251 CI->getArgOperand(0), &attributes, in visitCallSPRIVImageQuerySize()
252 CI, &mangle, CI->getName(), false); in visitCallSPRIVImageQuerySize()
255 if (CI->getType()->getScalarType() != int32Ty) { in visitCallSPRIVImageQuerySize()
257 CastInst::CreateIntegerCast(getImageSize, CI->getType()->getScalarType(), false, in visitCallSPRIVImageQuerySize()
258 CI->getName(), CI); in visitCallSPRIVImageQuerySize()
262 assert(CI->getType()->isVectorTy() && "this code can handle vector result type only"); in visitCallSPRIVImageQuerySize()
268 CI->getArgOperand(0), &attributes, in visitCallSPRIVImageQuerySize()
269 CI, &mangle, CI->getName(), false); in visitCallSPRIVImageQuerySize()
272 if (CI->getType()->getScalarType() != int32Ty) { in visitCallSPRIVImageQuerySize()
275 VectorType::get(CI->getType()->getScalarType(), in visitCallSPRIVImageQuerySize()
277 false, CI->getName(), CI); in visitCallSPRIVImageQuerySize()
282 assert(CI->getType()->isVectorTy() && in visitCallSPRIVImageQuerySize()
284 const unsigned imgQuerySizeRetEls = CI->getType()->getVectorNumElements(); in visitCallSPRIVImageQuerySize()
292 InsertElementInst::Create(UndefValue::get(CI->getType()), getImageSize, in visitCallSPRIVImageQuerySize()
293 ConstantInt::get(int32Ty, 0), CI->getName(), CI); in visitCallSPRIVImageQuerySize()
304 mask, CI->getName(), CI); in visitCallSPRIVImageQuerySize()
314 CI->getArgOperand(0), &attributes, in visitCallSPRIVImageQuerySize()
315 CI, &mangle, CI->getName(), false); in visitCallSPRIVImageQuerySize()
318 if (getImageArraySize->getType() != CI->getType()->getScalarType()) { in visitCallSPRIVImageQuerySize()
320 CastInst::CreateIntegerCast(getImageArraySize, CI->getType()->getScalarType(), in visitCallSPRIVImageQuerySize()
321 false, CI->getName(), CI); in visitCallSPRIVImageQuerySize()
326 CI->getType()->getVectorNumElements() - 1), in visitCallSPRIVImageQuerySize()
327 CI->getName(), CI); in visitCallSPRIVImageQuerySize()
331 CI->replaceAllUsesWith(getImageSize); in visitCallSPRIVImageQuerySize()
332 CI->eraseFromParent(); in visitCallSPRIVImageQuerySize()
335 void SPIRVToOCL20::visitCallSPIRVAtomicBuiltin(CallInst* CI, Op OC) { in visitCallSPIRVAtomicBuiltin() argument
336 AttributeSet Attrs = CI->getCalledFunction()->getAttributes(); in visitCallSPIRVAtomicBuiltin()
337 Instruction * pInsertBefore = CI; in visitCallSPIRVAtomicBuiltin()
339 mutateCallInstOCL(M, CI, [=](CallInst *, std::vector<Value *> &Args, Type *& RetTy){ in visitCallSPIRVAtomicBuiltin()
372 AllocaInst *pExpected = new AllocaInst(CI->getType(), "expected", in visitCallSPIRVAtomicBuiltin()
374 pExpected->setAlignment(CI->getType()->getScalarSizeInBits() / 8); in visitCallSPIRVAtomicBuiltin()
383 [=](CallInst * CI) -> Instruction * { in visitCallSPIRVAtomicBuiltin() argument
390 LoadInst * pOriginal = new LoadInst(CI->getArgOperand(1), "original", pInsertBefore); in visitCallSPIRVAtomicBuiltin()
394 return CI; in visitCallSPIRVAtomicBuiltin()
399 void SPIRVToOCL20::visitCallSPIRVBuiltin(CallInst* CI, Op OC) { in visitCallSPIRVBuiltin() argument
400 AttributeSet Attrs = CI->getCalledFunction()->getAttributes(); in visitCallSPIRVBuiltin()
401 mutateCallInstOCL(M, CI, [=](CallInst *, std::vector<Value *> &Args){ in visitCallSPIRVBuiltin()
406 void SPIRVToOCL20::visitCallSPIRVGroupBuiltin(CallInst* CI, Op OC) { in visitCallSPIRVGroupBuiltin() argument
410 std::string Prefix = getGroupBuiltinPrefix(CI); in visitCallSPIRVGroupBuiltin()
416 auto GO = getArgAs<spv::GroupOperation>(CI, 1); in visitCallSPIRVGroupBuiltin()
425 AttributeSet Attrs = CI->getCalledFunction()->getAttributes(); in visitCallSPIRVGroupBuiltin()
426 mutateCallInstOCL(M, CI, [=](CallInst *, std::vector<Value *> &Args){ in visitCallSPIRVGroupBuiltin()
429 expandVector(CI, Args, 1); in visitCallSPIRVGroupBuiltin()
434 void SPIRVToOCL20::visitCallSPIRVPipeBuiltin(CallInst* CI, Op OC) { in visitCallSPIRVPipeBuiltin() argument
450 DemangledName = getGroupBuiltinPrefix(CI) + DemangledName; in visitCallSPIRVPipeBuiltin()
452 AttributeSet Attrs = CI->getCalledFunction()->getAttributes(); in visitCallSPIRVPipeBuiltin()
453 mutateCallInstOCL(M, CI, [=](CallInst *, std::vector<Value *> &Args){ in visitCallSPIRVPipeBuiltin()
470 P = CastInst::CreatePointerBitCastOrAddrSpaceCast(P, NewTy, "", CI); in visitCallSPIRVPipeBuiltin()
494 SPIRVToOCL20::getGroupBuiltinPrefix(CallInst* CI) { in getGroupBuiltinPrefix() argument
496 auto ES = getArgAsScope(CI, 0); in getGroupBuiltinPrefix()