Lines Matching defs:FPOp

78   bool fold_pow(FPMathOperator *FPOp, IRBuilder<> &B, const FuncInfo &FInfo);
81 bool fold_rootn(FPMathOperator *FPOp, IRBuilder<> &B, const FuncInfo &FInfo);
99 bool fold_sincos(FPMathOperator *FPOp, IRBuilder<> &B, const FuncInfo &FInfo);
124 bool isUnsafeMath(const FPMathOperator *FPOp) const;
125 bool isUnsafeFiniteOnlyMath(const FPMathOperator *FPOp) const;
127 bool canIncreasePrecisionOfConstantFold(const FPMathOperator *FPOp) const;
422 bool AMDGPULibCalls::isUnsafeMath(const FPMathOperator *FPOp) const {
423 return UnsafeFPMath || FPOp->isFast();
426 bool AMDGPULibCalls::isUnsafeFiniteOnlyMath(const FPMathOperator *FPOp) const {
428 (FPOp->hasApproxFunc() && FPOp->hasNoNaNs() && FPOp->hasNoInfs());
432 const FPMathOperator *FPOp) const {
434 return isUnsafeMath(FPOp);
672 if (FPMathOperator *FPOp = dyn_cast<FPMathOperator>(CI)) {
676 if (canIncreasePrecisionOfConstantFold(FPOp) && evaluateCall(CI, FInfo))
680 FastMathFlags FMF = FPOp->getFastMathFlags();
765 CallInst *Call = cast<CallInst>(FPOp);
771 FPOp->getOperand(0), /*Depth=*/0,
774 return fold_pow(FPOp, B, PowrInfo) || true;
778 if (isKnownIntegral(FPOp->getOperand(1), M->getDataLayout(),
779 FPOp->getFastMathFlags())) {
788 B.CreateFPToSI(FPOp->getOperand(1), PownType->getParamType(1));
794 return fold_pow(FPOp, B, PownInfo) || true;
798 return fold_pow(FPOp, B, FInfo);
802 return fold_pow(FPOp, B, FInfo);
804 return fold_rootn(FPOp, B, FInfo);
811 return fold_sincos(FPOp, B, FInfo);
903 bool AMDGPULibCalls::fold_pow(FPMathOperator *FPOp, IRBuilder<> &B,
911 Type *eltType = FPOp->getType()->getScalarType();
912 Value *opr0 = FPOp->getOperand(0);
913 Value *opr1 = FPOp->getOperand(1);
925 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> 1\n");
930 replaceCall(FPOp, cnval);
935 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> " << *opr0 << "\n");
936 replaceCall(FPOp, opr0);
941 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> " << *opr0 << " * "
944 replaceCall(FPOp, nval);
949 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> 1 / " << *opr0 << "\n");
955 replaceCall(FPOp, nval);
966 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> " << FInfo.getName()
970 replaceCall(FPOp, nval);
975 if (!isUnsafeFiniteOnlyMath(FPOp))
1023 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> "
1026 replaceCall(FPOp, nval);
1037 ExpExpr = Intrinsic::getDeclaration(M, Intrinsic::exp2, {FPOp->getType()});
1098 if (!isKnownIntegral(opr1, M->getDataLayout(), FPOp->getFastMathFlags()))
1112 Intrinsic::getDeclaration(M, Intrinsic::log2, {FPOp->getType()});
1131 Type *nTy = FPOp->getType()->getWithNewType(nTyS);
1133 Value *opr_n = FPOp->getOperand(1);
1145 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> "
1147 replaceCall(FPOp, nval);
1152 bool AMDGPULibCalls::fold_rootn(FPMathOperator *FPOp, IRBuilder<> &B,
1154 Value *opr0 = FPOp->getOperand(0);
1155 Value *opr1 = FPOp->getOperand(1);
1168 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> " << *opr0 << '\n');
1169 replaceCall(FPOp, opr0);
1175 CallInst *CI = cast<CallInst>(FPOp);
1181 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> sqrt(" << *opr0 << ")\n");
1189 MDNode *FPMD = MDHelper.createFPMath(std::max(FPOp->getFPAccuracy(), 2.0f));
1199 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> cbrt(" << *opr0
1202 replaceCall(FPOp, nval);
1206 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> 1.0 / " << *opr0 << "\n");
1210 replaceCall(FPOp, nval);
1223 MDNode *FPMD = MDHelper.createFPMath(std::max(FPOp->getFPAccuracy(), 2.0f));
1226 FastMathFlags FMF = FPOp->getFastMathFlags();
1236 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> rsqrt(" << *opr0
1352 bool AMDGPULibCalls::fold_sincos(FPMathOperator *FPOp, IRBuilder<> &B,
1364 Value *CArgVal = FPOp->getOperand(0);
1365 CallInst *CI = cast<CallInst>(FPOp);
1399 FastMathFlags FMF = FPOp->getFastMathFlags();