Lines Matching defs:aCI
81 bool sincosUseNative(CallInst *aCI, const FuncInfo &FInfo);
86 bool evaluateCall(CallInst *aCI, const FuncInfo &FInfo);
451 bool AMDGPULibCalls::sincosUseNative(CallInst *aCI, const FuncInfo &FInfo) {
456 Module *M = aCI->getModule();
457 Value *opr0 = aCI->getArgOperand(0);
472 CallInst::Create(sinExpr, opr0, "splitsin", aCI->getIterator());
474 CallInst::Create(cosExpr, opr0, "splitcos", aCI->getIterator());
475 new StoreInst(cosval, aCI->getArgOperand(1), aCI->getIterator());
477 DEBUG_WITH_TYPE("usenative", dbgs() << "<useNative> replace " << *aCI
480 replaceCall(aCI, sinval);
487 bool AMDGPULibCalls::useNative(CallInst *aCI) {
488 Function *Callee = aCI->getCalledFunction();
489 if (!Callee || aCI->isNoBuiltin())
501 return sincosUseNative(aCI, FInfo);
504 FunctionCallee F = getFunction(aCI->getModule(), FInfo);
508 aCI->setCalledFunction(F);
509 DEBUG_WITH_TYPE("usenative", dbgs() << "<useNative> replace " << *aCI
1624 bool AMDGPULibCalls::evaluateCall(CallInst *aCI, const FuncInfo &FInfo) {
1625 int numArgs = (int)aCI->arg_size();
1632 if ((copr0 = dyn_cast<Constant>(aCI->getArgOperand(0))) == nullptr)
1637 if ((copr1 = dyn_cast<Constant>(aCI->getArgOperand(1))) == nullptr) {
1643 // At this point, all arguments to aCI are constants.
1665 LLVMContext &context = aCI->getContext();
1668 nval0 = ConstantFP::get(aCI->getType(), DVal0[0]);
1670 nval1 = ConstantFP::get(aCI->getType(), DVal1[0]);
1698 new StoreInst(nval1, aCI->getArgOperand(1), aCI->getIterator());
1701 replaceCall(aCI, nval0);