From e23be09e66d6860ec739b57d7821a7671d715a35 Mon Sep 17 00:00:00 2001 From: David Bolvansky Date: Thu, 11 Jul 2019 10:55:04 +0000 Subject: [InstCombine] Reorder recently added/improved pow transformations Changed cases are now faster with exp2. llvm-svn: 365758 --- llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Transforms/Utils') 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(Expo) || isa(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 -- cgit v1.2.3