diff options
Diffstat (limited to 'llvm/test/Transforms/InstCombine/fcmp-special.ll')
| -rw-r--r-- | llvm/test/Transforms/InstCombine/fcmp-special.ll | 47 |
1 files changed, 32 insertions, 15 deletions
diff --git a/llvm/test/Transforms/InstCombine/fcmp-special.ll b/llvm/test/Transforms/InstCombine/fcmp-special.ll index 565da9621ca..1966ee0339e 100644 --- a/llvm/test/Transforms/InstCombine/fcmp-special.ll +++ b/llvm/test/Transforms/InstCombine/fcmp-special.ll @@ -3,7 +3,7 @@ define i1 @oeq_self(double %arg) { ; CHECK-LABEL: @oeq_self( -; CHECK-NEXT: [[TMP:%.*]] = fcmp ord double %arg, 0.000000e+00 +; CHECK-NEXT: [[TMP:%.*]] = fcmp ord double [[ARG:%.*]], 0.000000e+00 ; CHECK-NEXT: ret i1 [[TMP]] ; %tmp = fcmp oeq double %arg, %arg @@ -14,7 +14,7 @@ define i1 @oeq_self(double %arg) { define i1 @une_self(double %x) { ; CHECK-LABEL: @une_self( -; CHECK-NEXT: [[TMP:%.*]] = fcmp uno double %x, 0.000000e+00 +; CHECK-NEXT: [[TMP:%.*]] = fcmp uno double [[X:%.*]], 0.000000e+00 ; CHECK-NEXT: ret i1 [[TMP]] ; %tmp = fcmp une double %x, %x @@ -26,7 +26,7 @@ define i1 @une_self(double %x) { define i1 @ord_zero(float %x) { ; CHECK-LABEL: @ord_zero( -; CHECK-NEXT: [[F:%.*]] = fcmp ord float %x, 0.000000e+00 +; CHECK-NEXT: [[F:%.*]] = fcmp ord float [[X:%.*]], 0.000000e+00 ; CHECK-NEXT: ret i1 [[F]] ; %f = fcmp ord float %x, 0.0 @@ -35,7 +35,7 @@ define i1 @ord_zero(float %x) { define i1 @ord_nonzero(double %x) { ; CHECK-LABEL: @ord_nonzero( -; CHECK-NEXT: [[F:%.*]] = fcmp ord double %x, 0.000000e+00 +; CHECK-NEXT: [[F:%.*]] = fcmp ord double [[X:%.*]], 0.000000e+00 ; CHECK-NEXT: ret i1 [[F]] ; %f = fcmp ord double %x, 3.0 @@ -44,7 +44,7 @@ define i1 @ord_nonzero(double %x) { define i1 @ord_self(float %x) { ; CHECK-LABEL: @ord_self( -; CHECK-NEXT: [[F:%.*]] = fcmp ord float %x, 0.000000e+00 +; CHECK-NEXT: [[F:%.*]] = fcmp ord float [[X:%.*]], 0.000000e+00 ; CHECK-NEXT: ret i1 [[F]] ; %f = fcmp ord float %x, %x @@ -53,7 +53,7 @@ define i1 @ord_self(float %x) { define i1 @uno_zero(double %x) { ; CHECK-LABEL: @uno_zero( -; CHECK-NEXT: [[F:%.*]] = fcmp uno double %x, 0.000000e+00 +; CHECK-NEXT: [[F:%.*]] = fcmp uno double [[X:%.*]], 0.000000e+00 ; CHECK-NEXT: ret i1 [[F]] ; %f = fcmp uno double %x, 0.0 @@ -62,7 +62,7 @@ define i1 @uno_zero(double %x) { define i1 @uno_nonzero(float %x) { ; CHECK-LABEL: @uno_nonzero( -; CHECK-NEXT: [[F:%.*]] = fcmp uno float %x, 0.000000e+00 +; CHECK-NEXT: [[F:%.*]] = fcmp uno float [[X:%.*]], 0.000000e+00 ; CHECK-NEXT: ret i1 [[F]] ; %f = fcmp uno float %x, 3.0 @@ -71,7 +71,7 @@ define i1 @uno_nonzero(float %x) { define i1 @uno_self(double %x) { ; CHECK-LABEL: @uno_self( -; CHECK-NEXT: [[F:%.*]] = fcmp uno double %x, 0.000000e+00 +; CHECK-NEXT: [[F:%.*]] = fcmp uno double [[X:%.*]], 0.000000e+00 ; CHECK-NEXT: ret i1 [[F]] ; %f = fcmp uno double %x, %x @@ -80,7 +80,7 @@ define i1 @uno_self(double %x) { define <2 x i1> @ord_zero_vec(<2 x double> %x) { ; CHECK-LABEL: @ord_zero_vec( -; CHECK-NEXT: [[F:%.*]] = fcmp ord <2 x double> %x, zeroinitializer +; CHECK-NEXT: [[F:%.*]] = fcmp ord <2 x double> [[X:%.*]], zeroinitializer ; CHECK-NEXT: ret <2 x i1> [[F]] ; %f = fcmp ord <2 x double> %x, zeroinitializer @@ -89,7 +89,7 @@ define <2 x i1> @ord_zero_vec(<2 x double> %x) { define <2 x i1> @ord_nonzero_vec(<2 x float> %x) { ; CHECK-LABEL: @ord_nonzero_vec( -; CHECK-NEXT: [[F:%.*]] = fcmp ord <2 x float> %x, zeroinitializer +; CHECK-NEXT: [[F:%.*]] = fcmp ord <2 x float> [[X:%.*]], zeroinitializer ; CHECK-NEXT: ret <2 x i1> [[F]] ; %f = fcmp ord <2 x float> %x, <float 3.0, float 5.0> @@ -98,7 +98,7 @@ define <2 x i1> @ord_nonzero_vec(<2 x float> %x) { define <2 x i1> @ord_self_vec(<2 x double> %x) { ; CHECK-LABEL: @ord_self_vec( -; CHECK-NEXT: [[F:%.*]] = fcmp ord <2 x double> %x, zeroinitializer +; CHECK-NEXT: [[F:%.*]] = fcmp ord <2 x double> [[X:%.*]], zeroinitializer ; CHECK-NEXT: ret <2 x i1> [[F]] ; %f = fcmp ord <2 x double> %x, %x @@ -107,7 +107,7 @@ define <2 x i1> @ord_self_vec(<2 x double> %x) { define <2 x i1> @uno_zero_vec(<2 x float> %x) { ; CHECK-LABEL: @uno_zero_vec( -; CHECK-NEXT: [[F:%.*]] = fcmp uno <2 x float> %x, zeroinitializer +; CHECK-NEXT: [[F:%.*]] = fcmp uno <2 x float> [[X:%.*]], zeroinitializer ; CHECK-NEXT: ret <2 x i1> [[F]] ; %f = fcmp uno <2 x float> %x, zeroinitializer @@ -116,7 +116,7 @@ define <2 x i1> @uno_zero_vec(<2 x float> %x) { define <2 x i1> @uno_nonzero_vec(<2 x double> %x) { ; CHECK-LABEL: @uno_nonzero_vec( -; CHECK-NEXT: [[F:%.*]] = fcmp uno <2 x double> %x, zeroinitializer +; CHECK-NEXT: [[F:%.*]] = fcmp uno <2 x double> [[X:%.*]], zeroinitializer ; CHECK-NEXT: ret <2 x i1> [[F]] ; %f = fcmp uno <2 x double> %x, <double 3.0, double 5.0> @@ -125,7 +125,7 @@ define <2 x i1> @uno_nonzero_vec(<2 x double> %x) { define <2 x i1> @uno_self_vec(<2 x float> %x) { ; CHECK-LABEL: @uno_self_vec( -; CHECK-NEXT: [[F:%.*]] = fcmp uno <2 x float> %x, zeroinitializer +; CHECK-NEXT: [[F:%.*]] = fcmp uno <2 x float> [[X:%.*]], zeroinitializer ; CHECK-NEXT: ret <2 x i1> [[F]] ; %f = fcmp uno <2 x float> %x, %x @@ -137,13 +137,30 @@ define <2 x i1> @uno_self_vec(<2 x float> %x) { define <2 x i1> @uno_vec_with_nan(<2 x double> %x) { ; CHECK-LABEL: @uno_vec_with_nan( -; CHECK-NEXT: [[F:%.*]] = fcmp uno <2 x double> %x, <double 3.000000e+00, double 0x7FF00000FFFFFFFF> +; CHECK-NEXT: [[F:%.*]] = fcmp uno <2 x double> [[X:%.*]], <double 3.000000e+00, double 0x7FF00000FFFFFFFF> ; CHECK-NEXT: ret <2 x i1> [[F]] ; %f = fcmp uno <2 x double> %x, <double 3.0, double 0x7FF00000FFFFFFFF> ret <2 x i1> %f } +define <2 x i1> @uno_vec_with_undef(<2 x double> %x) { +; CHECK-LABEL: @uno_vec_with_undef( +; CHECK-NEXT: [[F:%.*]] = fcmp uno <2 x double> [[X:%.*]], zeroinitializer +; CHECK-NEXT: ret <2 x i1> [[F]] +; + %f = fcmp uno <2 x double> %x, <double 3.0, double undef> + ret <2 x i1> %f +} + +define <2 x i1> @ord_vec_with_undef(<2 x double> %x) { +; CHECK-LABEL: @ord_vec_with_undef( +; CHECK-NEXT: [[F:%.*]] = fcmp ord <2 x double> [[X:%.*]], zeroinitializer +; CHECK-NEXT: ret <2 x i1> [[F]] +; + %f = fcmp ord <2 x double> %x, <double 0.0, double undef> + ret <2 x i1> %f +} ; TODO: This could be handled in InstSimplify. define i1 @nnan_ops_to_fcmp_ord(float %x, float %y) { |

