summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstSimplify/fast-math.ll
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2015-02-23 18:30:25 +0000
committerMehdi Amini <mehdi.amini@apple.com>2015-02-23 18:30:25 +0000
commitcd3ca6f7dd8122254ec1165d893a73e4679baf3c (patch)
tree5c013ec2c68196d5180450ab739d2a5d0c36f4f2 /llvm/test/Transforms/InstSimplify/fast-math.ll
parentcf0698987bff6ce3499f93912592d282b895b2b0 (diff)
downloadbcm5719-llvm-cd3ca6f7dd8122254ec1165d893a73e4679baf3c.tar.gz
bcm5719-llvm-cd3ca6f7dd8122254ec1165d893a73e4679baf3c.zip
InstSimplify: simplify 0 / X if nnan and nsz
From: Fiona Glaser <fglaser@apple.com> llvm-svn: 230238
Diffstat (limited to 'llvm/test/Transforms/InstSimplify/fast-math.ll')
-rw-r--r--llvm/test/Transforms/InstSimplify/fast-math.ll9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstSimplify/fast-math.ll b/llvm/test/Transforms/InstSimplify/fast-math.ll
index 71d1ed83849..e7fb14d7e78 100644
--- a/llvm/test/Transforms/InstSimplify/fast-math.ll
+++ b/llvm/test/Transforms/InstSimplify/fast-math.ll
@@ -105,3 +105,12 @@ define float @nofold_fadd_x_0(float %a) {
; CHECK: ret float %no_zero
ret float %no_zero
}
+
+; fdiv nsz nnan 0, X ==> 0
+define double @fdiv_zero_by_x(double %X) {
+; CHECK-LABEL: @fdiv_zero_by_x(
+; 0 / X -> 0
+ %r = fdiv nnan nsz double 0.0, %X
+ ret double %r
+; CHECK: ret double 0
+}
OpenPOWER on IntegriCloud