diff options
Diffstat (limited to 'llvm/test/Transforms/InstCombine/and-fcmp.ll')
| -rw-r--r-- | llvm/test/Transforms/InstCombine/and-fcmp.ll | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/and-fcmp.ll b/llvm/test/Transforms/InstCombine/and-fcmp.ll index 553533392c1..7bf300d9a14 100644 --- a/llvm/test/Transforms/InstCombine/and-fcmp.ll +++ b/llvm/test/Transforms/InstCombine/and-fcmp.ll @@ -28,6 +28,30 @@ define <2 x i1> @t9(<2 x float> %a, <2 x double> %b) { ret <2 x i1> %and } +define i1 @fcmp_ord_nonzero(float %x, float %y) { +; CHECK-LABEL: @fcmp_ord_nonzero( +; CHECK-NEXT: [[TMP1:%.*]] = fcmp ord float %x, %y +; CHECK-NEXT: ret i1 [[TMP1]] +; + %cmp1 = fcmp ord float %x, 1.0 + %cmp2 = fcmp ord float %y, 2.0 + %and = and i1 %cmp1, %cmp2 + ret i1 %and +} + +define <3 x i1> @fcmp_ord_nonzero_vec(<3 x float> %x, <3 x float> %y) { +; CHECK-LABEL: @fcmp_ord_nonzero_vec( +; CHECK-NEXT: [[CMP1:%.*]] = fcmp ord <3 x float> %x, <float 1.000000e+00, float 2.000000e+00, float 3.000000e+00> +; CHECK-NEXT: [[CMP2:%.*]] = fcmp ord <3 x float> %y, <float 3.000000e+00, float 2.000000e+00, float 1.000000e+00> +; CHECK-NEXT: [[AND:%.*]] = and <3 x i1> [[CMP1]], [[CMP2]] +; CHECK-NEXT: ret <3 x i1> [[AND]] +; + %cmp1 = fcmp ord <3 x float> %x, <float 1.0, float 2.0, float 3.0> + %cmp2 = fcmp ord <3 x float> %y, <float 3.0, float 2.0, float 1.0> + %and = and <3 x i1> %cmp1, %cmp2 + ret <3 x i1> %and +} + define i1 @auto_gen_0(double %a, double %b) { ; CHECK-LABEL: @auto_gen_0( ; CHECK-NEXT: ret i1 false |

