diff options
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp index b481d2b50a8..bc55e77c44f 100644 --- a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp @@ -1471,6 +1471,9 @@ Value *LibCallSimplifier::optimizePow(CallInst *Pow, IRBuilder<> &B) { if (match(Base, m_FPOne())) return Base; + if (Value *Exp = replacePowWithExp(Pow, B)) + return Exp; + // powf(x, sitofp(e)) -> powi(x, e) // powf(x, uitofp(e)) -> powi(x, e) if (AllowApprox && (isa<SIToFPInst>(Expo) || isa<UIToFPInst>(Expo))) { @@ -1486,9 +1489,6 @@ Value *LibCallSimplifier::optimizePow(CallInst *Pow, IRBuilder<> &B) { return createPowWithIntegerExponent(Base, NewExpo, M, B); } - if (Value *Exp = replacePowWithExp(Pow, B)) - return Exp; - // Evaluate special cases related to the exponent. // pow(x, -1.0) -> 1.0 / x |