Lines Matching defs:FPOp

75   bool fold_pow(FPMathOperator *FPOp, IRBuilder<> &B, const FuncInfo &FInfo);
78 bool fold_rootn(FPMathOperator *FPOp, IRBuilder<> &B, const FuncInfo &FInfo);
96 bool fold_sincos(FPMathOperator *FPOp, IRBuilder<> &B, const FuncInfo &FInfo);
121 bool isUnsafeMath(const FPMathOperator *FPOp) const;
122 bool isUnsafeFiniteOnlyMath(const FPMathOperator *FPOp) const;
124 bool canIncreasePrecisionOfConstantFold(const FPMathOperator *FPOp) const;
419 bool AMDGPULibCalls::isUnsafeMath(const FPMathOperator *FPOp) const {
420 return UnsafeFPMath || FPOp->isFast();
423 bool AMDGPULibCalls::isUnsafeFiniteOnlyMath(const FPMathOperator *FPOp) const {
425 (FPOp->hasApproxFunc() && FPOp->hasNoNaNs() && FPOp->hasNoInfs());
429 const FPMathOperator *FPOp) const {
431 return isUnsafeMath(FPOp);
669 if (FPMathOperator *FPOp = dyn_cast<FPMathOperator>(CI)) {
673 if (canIncreasePrecisionOfConstantFold(FPOp) && evaluateCall(CI, FInfo))
677 FastMathFlags FMF = FPOp->getFastMathFlags();
762 CallInst *Call = cast<CallInst>(FPOp);
768 FPOp->getOperand(0), /*Depth=*/0,
771 return fold_pow(FPOp, B, PowrInfo) || true;
775 if (isKnownIntegral(FPOp->getOperand(1), M->getDataLayout(),
776 FPOp->getFastMathFlags())) {
785 B.CreateFPToSI(FPOp->getOperand(1), PownType->getParamType(1));
792 return fold_pow(FPOp, B, PownInfo) || true;
796 return fold_pow(FPOp, B, FInfo);
800 return fold_pow(FPOp, B, FInfo);
802 return fold_rootn(FPOp, B, FInfo);
809 return fold_sincos(FPOp, B, FInfo);
901 bool AMDGPULibCalls::fold_pow(FPMathOperator *FPOp, IRBuilder<> &B,
909 Type *eltType = FPOp->getType()->getScalarType();
910 Value *opr0 = FPOp->getOperand(0);
911 Value *opr1 = FPOp->getOperand(1);
923 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> 1\n");
928 replaceCall(FPOp, cnval);
933 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> " << *opr0 << "\n");
934 replaceCall(FPOp, opr0);
939 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> " << *opr0 << " * "
942 replaceCall(FPOp, nval);
947 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> 1 / " << *opr0 << "\n");
953 replaceCall(FPOp, nval);
964 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> " << FInfo.getName()
968 replaceCall(FPOp, nval);
973 if (!isUnsafeFiniteOnlyMath(FPOp))
1021 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> "
1024 replaceCall(FPOp, nval);
1036 {FPOp->getType()});
1097 if (!isKnownIntegral(opr1, M->getDataLayout(), FPOp->getFastMathFlags()))
1111 {FPOp->getType()});
1130 Type *nTy = FPOp->getType()->getWithNewType(nTyS);
1132 Value *opr_n = FPOp->getOperand(1);
1144 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> "
1146 replaceCall(FPOp, nval);
1151 bool AMDGPULibCalls::fold_rootn(FPMathOperator *FPOp, IRBuilder<> &B,
1153 Value *opr0 = FPOp->getOperand(0);
1154 Value *opr1 = FPOp->getOperand(1);
1167 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> " << *opr0 << '\n');
1168 replaceCall(FPOp, opr0);
1174 CallInst *CI = cast<CallInst>(FPOp);
1180 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> sqrt(" << *opr0 << ")\n");
1188 MDNode *FPMD = MDHelper.createFPMath(std::max(FPOp->getFPAccuracy(), 2.0f));
1198 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> cbrt(" << *opr0
1201 replaceCall(FPOp, nval);
1205 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> 1.0 / " << *opr0 << "\n");
1209 replaceCall(FPOp, nval);
1222 MDNode *FPMD = MDHelper.createFPMath(std::max(FPOp->getFPAccuracy(), 2.0f));
1225 FastMathFlags FMF = FPOp->getFastMathFlags();
1235 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> rsqrt(" << *opr0
1351 bool AMDGPULibCalls::fold_sincos(FPMathOperator *FPOp, IRBuilder<> &B,
1363 Value *CArgVal = FPOp->getOperand(0);
1364 CallInst *CI = cast<CallInst>(FPOp);
1398 FastMathFlags FMF = FPOp->getFastMathFlags();