[llvm] 770c578 - [FPEnv][InstSimplify] Prepush more tests for D106362.
Kevin P. Neal via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 4 10:49:09 PDT 2021
Author: Kevin P. Neal
Date: 2021-10-04T13:48:34-04:00
New Revision: 770c57898e12d04a8e4a5add904c57f86ce5385c
URL: https://github.com/llvm/llvm-project/commit/770c57898e12d04a8e4a5add904c57f86ce5385c
DIFF: https://github.com/llvm/llvm-project/commit/770c57898e12d04a8e4a5add904c57f86ce5385c.diff
LOG: [FPEnv][InstSimplify] Prepush more tests for D106362.
In working on D106362 I found that a few more tests were needed. I've
been asked to pre-push the tests for that ticket. This should complete
the tests needed for now.
Added:
Modified:
llvm/test/Transforms/InstSimplify/strictfp-fadd.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InstSimplify/strictfp-fadd.ll b/llvm/test/Transforms/InstSimplify/strictfp-fadd.ll
index 72c3350a40d28..8f917ba70854b 100644
--- a/llvm/test/Transforms/InstSimplify/strictfp-fadd.ll
+++ b/llvm/test/Transforms/InstSimplify/strictfp-fadd.ll
@@ -119,6 +119,24 @@ define <2 x float> @fadd_vec_x_n0_towardzero(<2 x float> %a) #0 {
ret <2 x float> %ret
}
+define float @fadd_nnan_x_n0_ebmaytrap(float %a) #0 {
+; CHECK-LABEL: @fadd_nnan_x_n0_ebmaytrap(
+; CHECK-NEXT: [[RET:%.*]] = call nnan float @llvm.experimental.constrained.fadd.f32(float [[A:%.*]], float -0.000000e+00, metadata !"round.tonearest", metadata !"fpexcept.maytrap") #[[ATTR0]]
+; CHECK-NEXT: ret float [[RET]]
+;
+ %ret = call nnan float @llvm.experimental.constrained.fadd.f32(float %a, float -0.0, metadata !"round.tonearest", metadata !"fpexcept.maytrap") #0
+ ret float %ret
+}
+
+define <2 x float> @fadd_vec_nnan_x_n0_ebmaytrap(<2 x float> %a) #0 {
+; CHECK-LABEL: @fadd_vec_nnan_x_n0_ebmaytrap(
+; CHECK-NEXT: [[RET:%.*]] = call nnan <2 x float> @llvm.experimental.constrained.fadd.v2f32(<2 x float> [[A:%.*]], <2 x float> <float -0.000000e+00, float -0.000000e+00>, metadata !"round.tonearest", metadata !"fpexcept.maytrap") #[[ATTR0]]
+; CHECK-NEXT: ret <2 x float> [[RET]]
+;
+ %ret = call nnan <2 x float> @llvm.experimental.constrained.fadd.v2f32(<2 x float> %a, <2 x float><float -0.0, float -0.0>, metadata !"round.tonearest", metadata !"fpexcept.maytrap") #0
+ ret <2 x float> %ret
+}
+
define float @fadd_nnan_x_n0_ebstrict(float %a) #0 {
; CHECK-LABEL: @fadd_nnan_x_n0_ebstrict(
; CHECK-NEXT: [[RET:%.*]] = call nnan float @llvm.experimental.constrained.fadd.f32(float [[A:%.*]], float -0.000000e+00, metadata !"round.tonearest", metadata !"fpexcept.strict") #[[ATTR0]]
@@ -231,6 +249,24 @@ define <2 x float> @fold_fadd_vec_nsz_x_0_ebmaytrap(<2 x float> %a) #0 {
ret <2 x float> %add
}
+define float @fold_fadd_nnan_nsz_x_0_ebmaytrap(float %a) #0 {
+; CHECK-LABEL: @fold_fadd_nnan_nsz_x_0_ebmaytrap(
+; CHECK-NEXT: [[ADD:%.*]] = call nnan nsz float @llvm.experimental.constrained.fadd.f32(float [[A:%.*]], float 0.000000e+00, metadata !"round.tonearest", metadata !"fpexcept.maytrap") #[[ATTR0]]
+; CHECK-NEXT: ret float [[ADD]]
+;
+ %add = call nnan nsz float @llvm.experimental.constrained.fadd.f32(float %a, float 0.0, metadata !"round.tonearest", metadata !"fpexcept.maytrap") #0
+ ret float %add
+}
+
+define <2 x float> @fold_fadd_vec_nnan_nsz_x_0_ebmaytrap(<2 x float> %a) #0 {
+; CHECK-LABEL: @fold_fadd_vec_nnan_nsz_x_0_ebmaytrap(
+; CHECK-NEXT: [[ADD:%.*]] = call nnan nsz <2 x float> @llvm.experimental.constrained.fadd.v2f32(<2 x float> [[A:%.*]], <2 x float> zeroinitializer, metadata !"round.tonearest", metadata !"fpexcept.maytrap") #[[ATTR0]]
+; CHECK-NEXT: ret <2 x float> [[ADD]]
+;
+ %add = call nnan nsz <2 x float> @llvm.experimental.constrained.fadd.v2f32(<2 x float> %a, <2 x float> zeroinitializer, metadata !"round.tonearest", metadata !"fpexcept.maytrap") #0
+ ret <2 x float> %add
+}
+
define float @fold_fadd_nsz_x_0_ebstrict(float %a) #0 {
; CHECK-LABEL: @fold_fadd_nsz_x_0_ebstrict(
; CHECK-NEXT: [[ADD:%.*]] = call nsz float @llvm.experimental.constrained.fadd.f32(float [[A:%.*]], float 0.000000e+00, metadata !"round.tonearest", metadata !"fpexcept.strict") #[[ATTR0]]
More information about the llvm-commits
mailing list