[InstSimplify, InstCombine] add/update tests with FP +0.0 vector with undef; NFC
llvm-svn: 328455
diff --git a/llvm/test/Transforms/InstSimplify/fast-math.ll b/llvm/test/Transforms/InstSimplify/fast-math.ll
index 4fdff7a..491658a 100644
--- a/llvm/test/Transforms/InstSimplify/fast-math.ll
+++ b/llvm/test/Transforms/InstSimplify/fast-math.ll
@@ -195,6 +195,24 @@
}
; fadd nsz X, 0 ==> X
+
+define <2 x float> @fadd_zero_nsz_vec(<2 x float> %x) {
+; CHECK-LABEL: @fadd_zero_nsz_vec(
+; CHECK-NEXT: ret <2 x float> [[X:%.*]]
+;
+ %r = fadd nsz <2 x float> %x, zeroinitializer
+ ret <2 x float> %r
+}
+
+define <2 x float> @fadd_zero_nsz_vec_undef(<2 x float> %x) {
+; CHECK-LABEL: @fadd_zero_nsz_vec_undef(
+; CHECK-NEXT: [[R:%.*]] = fadd nsz <2 x float> [[X:%.*]], <float 0.000000e+00, float undef>
+; CHECK-NEXT: ret <2 x float> [[R]]
+;
+ %r = fadd nsz <2 x float> %x, <float 0.0, float undef>
+ ret <2 x float> %r
+}
+
define float @nofold_fadd_x_0(float %a) {
; CHECK-LABEL: @nofold_fadd_x_0(
; CHECK-NEXT: [[NO_ZERO1:%.*]] = fadd ninf float [[A:%.*]], 0.000000e+00
@@ -239,6 +257,15 @@
ret double %r
}
+define <2 x double> @frem_poszero_by_x_vec_undef(<2 x double> %x) {
+; CHECK-LABEL: @frem_poszero_by_x_vec_undef(
+; CHECK-NEXT: [[R:%.*]] = frem nnan <2 x double> <double 0.000000e+00, double undef>, [[X:%.*]]
+; CHECK-NEXT: ret <2 x double> [[R]]
+;
+ %r = frem nnan <2 x double> <double 0.0, double undef>, %x
+ ret <2 x double> %r
+}
+
; -0 % X -> -0
; nsz is not necessary - frem result always has the sign of the dividend
diff --git a/llvm/test/Transforms/InstSimplify/floating-point-arithmetic.ll b/llvm/test/Transforms/InstSimplify/floating-point-arithmetic.ll
index 94179a6..4c5b5f0 100644
--- a/llvm/test/Transforms/InstSimplify/floating-point-arithmetic.ll
+++ b/llvm/test/Transforms/InstSimplify/floating-point-arithmetic.ll
@@ -62,12 +62,21 @@
}
; fsub X, 0 ==> X
-define float @fsub_x_0(float %a) {
+define float @fsub_x_0(float %x) {
; CHECK-LABEL: @fsub_x_0(
-; CHECK-NEXT: ret float [[A:%.*]]
+; CHECK-NEXT: ret float [[X:%.*]]
;
- %ret = fsub float %a, 0.0
- ret float %ret
+ %r = fsub float %x, 0.0
+ ret float %r
+}
+
+define <2 x float> @fsub_x_0_vec_undef(<2 x float> %x) {
+; CHECK-LABEL: @fsub_x_0_vec_undef(
+; CHECK-NEXT: [[R:%.*]] = fsub <2 x float> [[X:%.*]], <float undef, float 0.000000e+00>
+; CHECK-NEXT: ret <2 x float> [[R]]
+;
+ %r = fsub <2 x float> %x, <float undef, float 0.0>
+ ret <2 x float> %r
}
; fadd X, -0 ==> X