summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorYi Jiang <yjiang@apple.com>2013-12-12 01:55:04 +0000
committerYi Jiang <yjiang@apple.com>2013-12-12 01:55:04 +0000
commitf92a574246b391e905847e74b5e0283589c8741f (patch)
treef1617a8e57fa85330f1d62026e2183a7c6a87c2b /llvm/lib/Transforms
parent4705f8d842662050a88e9c0ac91ff337a5922fb6 (diff)
downloadbcm5719-llvm-f92a574246b391e905847e74b5e0283589c8741f.tar.gz
bcm5719-llvm-f92a574246b391e905847e74b5e0283589c8741f.zip
Resubmit r196544: Apply transformation on OS X 10.9+ and iOS 7.0+: pow(10, x) ―> __exp10(x)
llvm-svn: 197109
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
index 15b3e66f94a..b555cf8bddb 100644
--- a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
@@ -1162,6 +1162,12 @@ struct PowOpt : public UnsafeFPLibCallOptimization {
hasUnaryFloatFn(TLI, Op1->getType(), LibFunc::exp2, LibFunc::exp2f,
LibFunc::exp2l))
return EmitUnaryFloatFnCall(Op2, "exp2", B, Callee->getAttributes());
+ // pow(10.0, x) -> exp10(x)
+ if (Op1C->isExactlyValue(10.0) &&
+ hasUnaryFloatFn(TLI, Op1->getType(), LibFunc::exp10, LibFunc::exp10f,
+ LibFunc::exp10l))
+ return EmitUnaryFloatFnCall(Op2, TLI->getName(LibFunc::exp10), B,
+ Callee->getAttributes());
}
ConstantFP *Op2C = dyn_cast<ConstantFP>(Op2);
OpenPOWER on IntegriCloud