summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-08-31 18:19:35 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-08-31 18:19:35 +0000
commit2702caad08b3d18af57ee0edf9acc790910d1679 (patch)
tree48462450129a75d58a216d7d9f13f7f92dbdd550 /llvm/test/Transforms
parentdda6f242fb478b71b2136736fade976ccedfa82f (diff)
downloadbcm5719-llvm-2702caad08b3d18af57ee0edf9acc790910d1679.tar.gz
bcm5719-llvm-2702caad08b3d18af57ee0edf9acc790910d1679.zip
SimplifyLibCalls: When emitting an overloaded fp function check that it's available.
The existing code missed some edge cases when e.g. we're going to emit sqrtf but only the availability of sqrt was checked. This happens on odd platforms like windows. llvm-svn: 189724
Diffstat (limited to 'llvm/test/Transforms')
-rw-r--r--llvm/test/Transforms/InstCombine/win-math.ll20
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/win-math.ll b/llvm/test/Transforms/InstCombine/win-math.ll
index df3ac934a75..e6e79e2b84a 100644
--- a/llvm/test/Transforms/InstCombine/win-math.ll
+++ b/llvm/test/Transforms/InstCombine/win-math.ll
@@ -273,3 +273,23 @@ define float @float_round(float %x) nounwind readnone {
ret float %3
}
+declare float @powf(float, float)
+; win32 lacks sqrtf&fabsf, win64 lacks fabsf
+define float @float_powsqrt(float %x) nounwind readnone {
+; WIN32-LABEL: @float_powsqrt(
+; WIN32-NOT: float @sqrtf
+; WIN32: float @powf
+; WIN64-LABEL: @float_powsqrt(
+; WIN64-NOT: float @sqrtf
+; WIN64: float @powf
+; MINGW32-LABEL: @float_powsqrt(
+; MINGW32: float @sqrtf
+; MINGW32: float @fabsf
+; MINGW32-NOT: float @powf
+; MINGW64-LABEL: @float_powsqrt(
+; MINGW64: float @sqrtf
+; MINGW64: float @fabsf
+; MINGW64-NOT: float @powf
+ %1 = call float @powf(float %x, float 0.5)
+ ret float %1
+}
OpenPOWER on IntegriCloud