Lines Matching refs:FPOp

77   bool fold_pow(FPMathOperator *FPOp, IRBuilder<> &B, const FuncInfo &FInfo);
80 bool fold_rootn(FPMathOperator *FPOp, IRBuilder<> &B, const FuncInfo &FInfo);
98 bool fold_sincos(FPMathOperator *FPOp, IRBuilder<> &B, const FuncInfo &FInfo);
123 bool isUnsafeMath(const FPMathOperator *FPOp) const;
124 bool isUnsafeFiniteOnlyMath(const FPMathOperator *FPOp) const;
126 bool canIncreasePrecisionOfConstantFold(const FPMathOperator *FPOp) const;
421 bool AMDGPULibCalls::isUnsafeMath(const FPMathOperator *FPOp) const { in isUnsafeMath()
422 return UnsafeFPMath || FPOp->isFast(); in isUnsafeMath()
425 bool AMDGPULibCalls::isUnsafeFiniteOnlyMath(const FPMathOperator *FPOp) const { in isUnsafeFiniteOnlyMath()
427 (FPOp->hasApproxFunc() && FPOp->hasNoNaNs() && FPOp->hasNoInfs()); in isUnsafeFiniteOnlyMath()
431 const FPMathOperator *FPOp) const { in canIncreasePrecisionOfConstantFold()
433 return isUnsafeMath(FPOp); in canIncreasePrecisionOfConstantFold()
659 if (FPMathOperator *FPOp = dyn_cast<FPMathOperator>(CI)) { in fold() local
663 if (canIncreasePrecisionOfConstantFold(FPOp) && evaluateCall(CI, FInfo)) in fold()
667 FastMathFlags FMF = FPOp->getFastMathFlags(); in fold()
752 CallInst *Call = cast<CallInst>(FPOp); in fold()
757 cannotBeOrderedLessThanZero(FPOp->getOperand(0), M->getDataLayout(), in fold()
760 return fold_pow(FPOp, B, PowrInfo) || true; in fold()
764 if (isKnownIntegral(FPOp->getOperand(1), M->getDataLayout(), in fold()
765 FPOp->getFastMathFlags())) { in fold()
774 B.CreateFPToSI(FPOp->getOperand(1), PownType->getParamType(1)); in fold()
780 return fold_pow(FPOp, B, PownInfo) || true; in fold()
784 return fold_pow(FPOp, B, FInfo); in fold()
788 return fold_pow(FPOp, B, FInfo); in fold()
790 return fold_rootn(FPOp, B, FInfo); in fold()
797 return fold_sincos(FPOp, B, FInfo); in fold()
890 bool AMDGPULibCalls::fold_pow(FPMathOperator *FPOp, IRBuilder<> &B, in fold_pow() argument
898 Type *eltType = FPOp->getType()->getScalarType(); in fold_pow()
899 Value *opr0 = FPOp->getOperand(0); in fold_pow()
900 Value *opr1 = FPOp->getOperand(1); in fold_pow()
912 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> 1\n"); in fold_pow()
917 replaceCall(FPOp, cnval); in fold_pow()
922 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> " << *opr0 << "\n"); in fold_pow()
923 replaceCall(FPOp, opr0); in fold_pow()
928 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> " << *opr0 << " * " in fold_pow()
931 replaceCall(FPOp, nval); in fold_pow()
936 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> 1 / " << *opr0 << "\n"); in fold_pow()
942 replaceCall(FPOp, nval); in fold_pow()
953 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> " << FInfo.getName() in fold_pow()
957 replaceCall(FPOp, nval); in fold_pow()
962 if (!isUnsafeFiniteOnlyMath(FPOp)) in fold_pow()
1010 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> " in fold_pow()
1013 replaceCall(FPOp, nval); in fold_pow()
1024 ExpExpr = Intrinsic::getDeclaration(M, Intrinsic::exp2, {FPOp->getType()}); in fold_pow()
1086 if (!isKnownIntegral(opr1, M->getDataLayout(), FPOp->getFastMathFlags())) in fold_pow()
1100 Intrinsic::getDeclaration(M, Intrinsic::log2, {FPOp->getType()}); in fold_pow()
1125 opr_n = FPOp->getOperand(1); in fold_pow()
1137 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> " in fold_pow()
1139 replaceCall(FPOp, nval); in fold_pow()
1144 bool AMDGPULibCalls::fold_rootn(FPMathOperator *FPOp, IRBuilder<> &B, in fold_rootn() argument
1150 Value *opr0 = FPOp->getOperand(0); in fold_rootn()
1151 Value *opr1 = FPOp->getOperand(1); in fold_rootn()
1159 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> " << *opr0 << "\n"); in fold_rootn()
1160 replaceCall(FPOp, opr0); in fold_rootn()
1168 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> sqrt(" << *opr0 in fold_rootn()
1171 replaceCall(FPOp, nval); in fold_rootn()
1177 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> cbrt(" << *opr0 in fold_rootn()
1180 replaceCall(FPOp, nval); in fold_rootn()
1184 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> 1.0 / " << *opr0 << "\n"); in fold_rootn()
1188 replaceCall(FPOp, nval); in fold_rootn()
1193 LLVM_DEBUG(errs() << "AMDIC: " << *FPOp << " ---> rsqrt(" << *opr0 in fold_rootn()
1196 replaceCall(FPOp, nval); in fold_rootn()
1310 bool AMDGPULibCalls::fold_sincos(FPMathOperator *FPOp, IRBuilder<> &B, in fold_sincos() argument
1322 Value *CArgVal = FPOp->getOperand(0); in fold_sincos()
1323 CallInst *CI = cast<CallInst>(FPOp); in fold_sincos()
1357 FastMathFlags FMF = FPOp->getFastMathFlags(); in fold_sincos()