Lines Matching refs:Pow
2038 Value *LibCallSimplifier::replacePowWithExp(CallInst *Pow, IRBuilderBase &B) { in replacePowWithExp() argument
2039 Module *M = Pow->getModule(); in replacePowWithExp()
2040 Value *Base = Pow->getArgOperand(0), *Expo = Pow->getArgOperand(1); in replacePowWithExp()
2041 Type *Ty = Pow->getType(); in replacePowWithExp()
2060 if (BaseFn && BaseFn->hasOneUse() && BaseFn->isFast() && Pow->isFast()) { in replacePowWithExp()
2119 const bool UseIntrinsic = Pow->doesNotAccessMemory(); in replacePowWithExp()
2133 return copyFlags(*Pow, B.CreateIntrinsic(Intrinsic::ldexp, in replacePowWithExp()
2135 {One, ExpoI}, Pow, "exp2")); in replacePowWithExp()
2138 return copyFlags(*Pow, emitBinaryFloatFnCall( in replacePowWithExp()
2158 if (Pow->doesNotAccessMemory()) in replacePowWithExp()
2159 return copyFlags(*Pow, B.CreateUnaryIntrinsic(Intrinsic::exp2, FMul, in replacePowWithExp()
2162 return copyFlags(*Pow, emitUnaryFloatFnCall(FMul, TLI, LibFunc_exp2, in replacePowWithExp()
2172 if (Pow->doesNotAccessMemory()) { in replacePowWithExp()
2174 B.CreateIntrinsic(Intrinsic::exp10, {Ty}, {Expo}, Pow, "exp10"); in replacePowWithExp()
2175 return copyFlags(*Pow, NewExp10); in replacePowWithExp()
2178 return copyFlags(*Pow, emitUnaryFloatFnCall(Expo, TLI, LibFunc_exp10, in replacePowWithExp()
2184 if (Pow->hasApproxFunc() && Pow->hasNoNaNs() && BaseF->isFiniteNonZero() && in replacePowWithExp()
2199 if (Pow->doesNotAccessMemory()) in replacePowWithExp()
2200 return copyFlags(*Pow, B.CreateUnaryIntrinsic(Intrinsic::exp2, FMul, in replacePowWithExp()
2204 return copyFlags(*Pow, emitUnaryFloatFnCall(FMul, TLI, LibFunc_exp2, in replacePowWithExp()
2233 Value *LibCallSimplifier::replacePowWithSqrt(CallInst *Pow, IRBuilderBase &B) { in replacePowWithSqrt() argument
2234 Value *Sqrt, *Base = Pow->getArgOperand(0), *Expo = Pow->getArgOperand(1); in replacePowWithSqrt()
2235 Module *Mod = Pow->getModule(); in replacePowWithSqrt()
2236 Type *Ty = Pow->getType(); in replacePowWithSqrt()
2245 if (ExpoF->isNegative() && (!Pow->hasApproxFunc() && !Pow->hasAllowReassoc())) in replacePowWithSqrt()
2252 if (!Pow->doesNotAccessMemory() && !Pow->hasNoInfs() && in replacePowWithSqrt()
2254 SimplifyQuery(DL, TLI, /*DT=*/nullptr, AC, Pow))) in replacePowWithSqrt()
2257 Sqrt = getSqrtCall(Base, AttributeList(), Pow->doesNotAccessMemory(), Mod, B, in replacePowWithSqrt()
2263 if (!Pow->hasNoSignedZeros()) in replacePowWithSqrt()
2266 Sqrt = copyFlags(*Pow, Sqrt); in replacePowWithSqrt()
2270 if (!Pow->hasNoInfs()) { in replacePowWithSqrt()
2291 Value *LibCallSimplifier::optimizePow(CallInst *Pow, IRBuilderBase &B) { in optimizePow() argument
2292 Value *Base = Pow->getArgOperand(0); in optimizePow()
2293 Value *Expo = Pow->getArgOperand(1); in optimizePow()
2294 Function *Callee = Pow->getCalledFunction(); in optimizePow()
2296 Type *Ty = Pow->getType(); in optimizePow()
2297 Module *M = Pow->getModule(); in optimizePow()
2298 bool AllowApprox = Pow->hasApproxFunc(); in optimizePow()
2303 B.setFastMathFlags(Pow->getFastMathFlags()); in optimizePow()
2310 if (Value *Exp = replacePowWithExp(Pow, B)) in optimizePow()
2331 if (Value *Sqrt = replacePowWithSqrt(Pow, B)) in optimizePow()
2361 Sqrt = getSqrtCall(Base, AttributeList(), Pow->doesNotAccessMemory(), M, in optimizePow()
2374 *Pow, in optimizePow()
2389 return copyFlags(*Pow, createPowWithIntegerExponent(Base, ExpoI, M, B)); in optimizePow()
2396 if (Value *Shrunk = optimizeBinaryDoubleFP(Pow, B, TLI, true)) in optimizePow()