From 2d4e6504afa104d41de9f396f59143acc014a10c Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Tue, 12 Sep 2017 15:29:28 +0000 Subject: [PATCH] [InstCombine] move related tests together; NFC llvm-svn: 313036 --- llvm/test/Transforms/InstCombine/and-fcmp.ll | 16 +++++++++++++--- llvm/test/Transforms/InstCombine/and2.ll | 12 ------------ llvm/test/Transforms/InstCombine/or-fcmp.ll | 11 +++++++++++ llvm/test/Transforms/InstCombine/or.ll | 12 ------------ 4 files changed, 24 insertions(+), 27 deletions(-) diff --git a/llvm/test/Transforms/InstCombine/and-fcmp.ll b/llvm/test/Transforms/InstCombine/and-fcmp.ll index 04c6a2a08e72..7119ac17a559 100644 --- a/llvm/test/Transforms/InstCombine/and-fcmp.ll +++ b/llvm/test/Transforms/InstCombine/and-fcmp.ll @@ -1,9 +1,19 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; RUN: opt < %s -instcombine -S | FileCheck %s -; PR15737 -define i1 @t8(float %a, double %b) { -; CHECK-LABEL: @t8( +define i1 @PR1738(double %x, double %y) { +; CHECK-LABEL: @PR1738( +; CHECK-NEXT: [[TMP1:%.*]] = fcmp ord double %x, %y +; CHECK-NEXT: ret i1 [[TMP1]] +; + %cmp1 = fcmp ord double %x, 0.0 + %cmp2 = fcmp ord double %y, 0.0 + %and = and i1 %cmp1, %cmp2 + ret i1 %and +} + +define i1 @PR15737(float %a, double %b) { +; CHECK-LABEL: @PR15737( ; CHECK-NEXT: [[CMP:%.*]] = fcmp ord float %a, 0.000000e+00 ; CHECK-NEXT: [[CMP1:%.*]] = fcmp ord double %b, 0.000000e+00 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP]], [[CMP1]] diff --git a/llvm/test/Transforms/InstCombine/and2.ll b/llvm/test/Transforms/InstCombine/and2.ll index 15772d158f62..dde786c9b009 100644 --- a/llvm/test/Transforms/InstCombine/and2.ll +++ b/llvm/test/Transforms/InstCombine/and2.ll @@ -1,18 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; RUN: opt < %s -instcombine -S | FileCheck %s -; PR1738 -define i1 @test1(double %X, double %Y) { -; CHECK-LABEL: @test1( -; CHECK-NEXT: [[TMP1:%.*]] = fcmp ord double %Y, %X -; CHECK-NEXT: ret i1 [[TMP1]] -; - %tmp9 = fcmp ord double %X, 0.000000e+00 - %tmp13 = fcmp ord double %Y, 0.000000e+00 - %bothcond = and i1 %tmp13, %tmp9 - ret i1 %bothcond -} - define i1 @test2(i1 %X, i1 %Y) { ; CHECK-LABEL: @test2( ; CHECK-NEXT: [[B:%.*]] = and i1 %X, %Y diff --git a/llvm/test/Transforms/InstCombine/or-fcmp.ll b/llvm/test/Transforms/InstCombine/or-fcmp.ll index 7b95f9dde0e9..1c10424e3bc4 100644 --- a/llvm/test/Transforms/InstCombine/or-fcmp.ll +++ b/llvm/test/Transforms/InstCombine/or-fcmp.ll @@ -1,6 +1,17 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; RUN: opt < %s -instcombine -S | FileCheck %s +define i1 @PR1738(double %x, double %y) { +; CHECK-LABEL: @PR1738( +; CHECK-NEXT: [[TMP1:%.*]] = fcmp uno double %x, %y +; CHECK-NEXT: ret i1 [[TMP1]] +; + %cmp1 = fcmp uno double %x, 0.0 + %cmp2 = fcmp uno double %y, 0.0 + %or = or i1 %cmp1, %cmp2 + ret i1 %or +} + define i1 @fcmp_uno_nonzero(float %x, float %y) { ; CHECK-LABEL: @fcmp_uno_nonzero( ; CHECK-NEXT: [[TMP1:%.*]] = fcmp uno float %x, %y diff --git a/llvm/test/Transforms/InstCombine/or.ll b/llvm/test/Transforms/InstCombine/or.ll index 6a4ed05c399d..644588526ca8 100644 --- a/llvm/test/Transforms/InstCombine/or.ll +++ b/llvm/test/Transforms/InstCombine/or.ll @@ -156,18 +156,6 @@ define <2 x i16> @test23vec(<2 x i16> %A) { ret <2 x i16> %D } -; PR1738 -define i1 @test24(double %X, double %Y) { -; CHECK-LABEL: @test24( -; CHECK-NEXT: [[TMP1:%.*]] = fcmp uno double %Y, %X -; CHECK-NEXT: ret i1 [[TMP1]] -; - %tmp9 = fcmp uno double %X, 0.000000e+00 - %tmp13 = fcmp uno double %Y, 0.000000e+00 - %bothcond = or i1 %tmp13, %tmp9 - ret i1 %bothcond -} - ; PR3266 & PR5276 define i1 @test25(i32 %A, i32 %B) { ; CHECK-LABEL: @test25(