Skip to content

Commit 785fe71

Browse files
committed
update test with ninf and nnan flag
1 parent e62038e commit 785fe71

File tree

1 file changed

+48
-92
lines changed
  • llvm/test/Transforms/InstCombine

1 file changed

+48
-92
lines changed

llvm/test/Transforms/InstCombine/fcmp.ll

Lines changed: 48 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1631,134 +1631,90 @@ define <8 x i1> @fcmp_one_sel_x_negx_vec(<8 x float> %x) {
16311631
ret <8 x i1> %res
16321632
}
16331633

1634-
define <2 x i1> @fcmp_oeq_sel_x_negx_with_any_fpzero_vec(<2 x i1> %cond, <2 x float> %x) {
1635-
; CHECK-LABEL: @fcmp_oeq_sel_x_negx_with_any_fpzero_vec(
1636-
; CHECK-NEXT: [[ICMP:%.*]] = fcmp oeq <2 x float> [[X:%.*]], zeroinitializer
1634+
define <2 x i1> @fcmp_oeq_sel_x_negx_with_any_fpzero_ninf_vec(<2 x i1> %cond, <2 x float> %x) {
1635+
; CHECK-LABEL: @fcmp_oeq_sel_x_negx_with_any_fpzero_ninf_vec(
1636+
; CHECK-NEXT: [[ICMP:%.*]] = fcmp ninf oeq <2 x float> [[X:%.*]], zeroinitializer
16371637
; CHECK-NEXT: ret <2 x i1> [[ICMP]]
16381638
;
16391639
%fneg = fneg <2 x float> %x
16401640
%sel = select <2 x i1> %cond, <2 x float> %x, <2 x float> %fneg
1641-
%icmp = fcmp oeq <2 x float> %sel, <float 0.0, float -0.0>
1641+
%icmp = fcmp ninf oeq <2 x float> %sel, <float 0.0, float -0.0>
16421642
ret <2 x i1> %icmp
16431643
}
16441644

1645-
define <2 x i1> @fcmp_one_sel_x_negx_with_any_fpzero_vec(<2 x i1> %cond, <2 x float> %x) {
1646-
; CHECK-LABEL: @fcmp_one_sel_x_negx_with_any_fpzero_vec(
1647-
; CHECK-NEXT: [[ICMP:%.*]] = fcmp one <2 x float> [[X:%.*]], zeroinitializer
1645+
define <2 x i1> @fcmp_one_sel_x_negx_with_any_fpzero_ninf_vec(<2 x i1> %cond, <2 x float> %x) {
1646+
; CHECK-LABEL: @fcmp_one_sel_x_negx_with_any_fpzero_ninf_vec(
1647+
; CHECK-NEXT: [[ICMP:%.*]] = fcmp ninf one <2 x float> [[X:%.*]], zeroinitializer
16481648
; CHECK-NEXT: ret <2 x i1> [[ICMP]]
16491649
;
16501650
%fneg = fneg <2 x float> %x
16511651
%sel = select <2 x i1> %cond, <2 x float> %x, <2 x float> %fneg
1652-
%icmp = fcmp one <2 x float> %sel, <float 0.0, float -0.0>
1652+
%icmp = fcmp ninf one <2 x float> %sel, <float 0.0, float -0.0>
16531653
ret <2 x i1> %icmp
16541654
}
16551655

1656-
define <2 x i1> @fcmp_ueq_sel_x_negx_with_any_fpzero_vec(<2 x i1> %cond, <2 x float> %x) {
1657-
; CHECK-LABEL: @fcmp_ueq_sel_x_negx_with_any_fpzero_vec(
1658-
; CHECK-NEXT: [[ICMP:%.*]] = fcmp ueq <2 x float> [[X:%.*]], zeroinitializer
1656+
define <2 x i1> @fcmp_ueq_sel_x_negx_with_any_fpzero_ninf_vec(<2 x i1> %cond, <2 x float> %x) {
1657+
; CHECK-LABEL: @fcmp_ueq_sel_x_negx_with_any_fpzero_ninf_vec(
1658+
; CHECK-NEXT: [[ICMP:%.*]] = fcmp ninf ueq <2 x float> [[X:%.*]], zeroinitializer
16591659
; CHECK-NEXT: ret <2 x i1> [[ICMP]]
16601660
;
16611661
%fneg = fneg <2 x float> %x
16621662
%sel = select <2 x i1> %cond, <2 x float> %x, <2 x float> %fneg
1663-
%icmp = fcmp ueq <2 x float> %sel, <float 0.0, float -0.0>
1663+
%icmp = fcmp ninf ueq <2 x float> %sel, <float 0.0, float -0.0>
16641664
ret <2 x i1> %icmp
16651665
}
16661666

1667-
define <2 x i1> @fcmp_une_sel_x_negx_with_any_fpzero_vec(<2 x i1> %cond, <2 x float> %x) {
1668-
; CHECK-LABEL: @fcmp_une_sel_x_negx_with_any_fpzero_vec(
1669-
; CHECK-NEXT: [[ICMP:%.*]] = fcmp une <2 x float> [[X:%.*]], zeroinitializer
1667+
define <2 x i1> @fcmp_une_sel_x_negx_with_any_fpzero_ninf_vec(<2 x i1> %cond, <2 x float> %x) {
1668+
; CHECK-LABEL: @fcmp_une_sel_x_negx_with_any_fpzero_ninf_vec(
1669+
; CHECK-NEXT: [[ICMP:%.*]] = fcmp ninf une <2 x float> [[X:%.*]], zeroinitializer
16701670
; CHECK-NEXT: ret <2 x i1> [[ICMP]]
16711671
;
16721672
%fneg = fneg <2 x float> %x
16731673
%sel = select <2 x i1> %cond, <2 x float> %x, <2 x float> %fneg
1674-
%icmp = fcmp une <2 x float> %sel, <float 0.0, float -0.0>
1674+
%icmp = fcmp ninf une <2 x float> %sel, <float 0.0, float -0.0>
16751675
ret <2 x i1> %icmp
16761676
}
16771677

1678-
define i1 @fcmp_ueq_sel_x_negx_with_fmf(float %x, i1 %c) {
1679-
; CHECK-LABEL: @fcmp_ueq_sel_x_negx_with_fmf(
1680-
; CHECK-NEXT: [[RES:%.*]] = fcmp fast ueq float [[X:%.*]], 0.000000e+00
1681-
; CHECK-NEXT: ret i1 [[RES]]
1682-
;
1683-
%neg = fneg float %x
1684-
%sel = select i1 %c, float %x, float %neg
1685-
%res = fcmp fast ueq float %sel, 0.000000e+00
1686-
ret i1 %res
1687-
}
1688-
1689-
define i1 @fcmp_une_sel_x_negx_with_fmf(float %x, i1 %c) {
1690-
; CHECK-LABEL: @fcmp_une_sel_x_negx_with_fmf(
1691-
; CHECK-NEXT: [[RES:%.*]] = fcmp fast une float [[X:%.*]], 0.000000e+00
1692-
; CHECK-NEXT: ret i1 [[RES]]
1693-
;
1694-
%neg = fneg float %x
1695-
%sel = select i1 %c, float %x, float %neg
1696-
%res = fcmp fast une float %sel, 0.000000e+00
1697-
ret i1 %res
1698-
}
1699-
1700-
define i1 @fcmp_oeq_sel_x_negx_with_fmf(float %x, i1 %c) {
1701-
; CHECK-LABEL: @fcmp_oeq_sel_x_negx_with_fmf(
1702-
; CHECK-NEXT: [[RES:%.*]] = fcmp fast oeq float [[X:%.*]], 0.000000e+00
1703-
; CHECK-NEXT: ret i1 [[RES]]
1704-
;
1705-
%neg = fneg float %x
1706-
%sel = select i1 %c, float %x, float %neg
1707-
%res = fcmp fast oeq float %sel, 0.000000e+00
1708-
ret i1 %res
1709-
}
1710-
1711-
define i1 @fcmp_one_sel_x_negx_with_fmf(float %x, i1 %c) {
1712-
; CHECK-LABEL: @fcmp_one_sel_x_negx_with_fmf(
1713-
; CHECK-NEXT: [[RES:%.*]] = fcmp fast one float [[X:%.*]], 0.000000e+00
1714-
; CHECK-NEXT: ret i1 [[RES]]
1715-
;
1716-
%neg = fneg float %x
1717-
%sel = select i1 %c, float %x, float %neg
1718-
%res = fcmp fast one float %sel, 0.000000e+00
1719-
ret i1 %res
1720-
}
1721-
1722-
define i1 @fcmp_ueq_sel_x_negx_nzero_with_fmf(float %x, i1 %c) {
1723-
; CHECK-LABEL: @fcmp_ueq_sel_x_negx_nzero_with_fmf(
1724-
; CHECK-NEXT: [[RES:%.*]] = fcmp fast ueq float [[X:%.*]], 0.000000e+00
1725-
; CHECK-NEXT: ret i1 [[RES]]
1678+
define <2 x i1> @fcmp_oeq_sel_x_negx_with_any_fpzero_nnan_vec(<2 x i1> %cond, <2 x float> %x) {
1679+
; CHECK-LABEL: @fcmp_oeq_sel_x_negx_with_any_fpzero_nnan_vec(
1680+
; CHECK-NEXT: [[ICMP:%.*]] = fcmp nnan oeq <2 x float> [[X:%.*]], zeroinitializer
1681+
; CHECK-NEXT: ret <2 x i1> [[ICMP]]
17261682
;
1727-
%neg = fneg float %x
1728-
%sel = select i1 %c, float %x, float %neg
1729-
%res = fcmp fast ueq float %sel, -0.000000e+00
1730-
ret i1 %res
1683+
%fneg = fneg <2 x float> %x
1684+
%sel = select <2 x i1> %cond, <2 x float> %x, <2 x float> %fneg
1685+
%icmp = fcmp nnan oeq <2 x float> %sel, <float 0.0, float -0.0>
1686+
ret <2 x i1> %icmp
17311687
}
17321688

1733-
define i1 @fcmp_une_sel_x_negx_nzero_with_fmf(float %x, i1 %c) {
1734-
; CHECK-LABEL: @fcmp_une_sel_x_negx_nzero_with_fmf(
1735-
; CHECK-NEXT: [[RES:%.*]] = fcmp fast une float [[X:%.*]], 0.000000e+00
1736-
; CHECK-NEXT: ret i1 [[RES]]
1689+
define <2 x i1> @fcmp_one_sel_x_negx_with_any_fpzero_nnan_vec(<2 x i1> %cond, <2 x float> %x) {
1690+
; CHECK-LABEL: @fcmp_one_sel_x_negx_with_any_fpzero_nnan_vec(
1691+
; CHECK-NEXT: [[ICMP:%.*]] = fcmp nnan one <2 x float> [[X:%.*]], zeroinitializer
1692+
; CHECK-NEXT: ret <2 x i1> [[ICMP]]
17371693
;
1738-
%neg = fneg float %x
1739-
%sel = select i1 %c, float %x, float %neg
1740-
%res = fcmp fast une float %sel, -0.000000e+00
1741-
ret i1 %res
1694+
%fneg = fneg <2 x float> %x
1695+
%sel = select <2 x i1> %cond, <2 x float> %x, <2 x float> %fneg
1696+
%icmp = fcmp nnan one <2 x float> %sel, <float 0.0, float -0.0>
1697+
ret <2 x i1> %icmp
17421698
}
17431699

1744-
define i1 @fcmp_oeq_sel_x_negx_nzero_with_fmf(float %x, i1 %c) {
1745-
; CHECK-LABEL: @fcmp_oeq_sel_x_negx_nzero_with_fmf(
1746-
; CHECK-NEXT: [[RES:%.*]] = fcmp fast oeq float [[X:%.*]], 0.000000e+00
1747-
; CHECK-NEXT: ret i1 [[RES]]
1700+
define <2 x i1> @fcmp_ueq_sel_x_negx_with_any_fpzero_nnan_vec(<2 x i1> %cond, <2 x float> %x) {
1701+
; CHECK-LABEL: @fcmp_ueq_sel_x_negx_with_any_fpzero_nnan_vec(
1702+
; CHECK-NEXT: [[ICMP:%.*]] = fcmp nnan ueq <2 x float> [[X:%.*]], zeroinitializer
1703+
; CHECK-NEXT: ret <2 x i1> [[ICMP]]
17481704
;
1749-
%neg = fneg float %x
1750-
%sel = select i1 %c, float %x, float %neg
1751-
%res = fcmp fast oeq float %sel, -0.000000e+00
1752-
ret i1 %res
1705+
%fneg = fneg <2 x float> %x
1706+
%sel = select <2 x i1> %cond, <2 x float> %x, <2 x float> %fneg
1707+
%icmp = fcmp nnan ueq <2 x float> %sel, <float 0.0, float -0.0>
1708+
ret <2 x i1> %icmp
17531709
}
17541710

1755-
define i1 @fcmp_one_sel_x_negx_nzero_with_fmf(float %x, i1 %c) {
1756-
; CHECK-LABEL: @fcmp_one_sel_x_negx_nzero_with_fmf(
1757-
; CHECK-NEXT: [[RES:%.*]] = fcmp fast one float [[X:%.*]], 0.000000e+00
1758-
; CHECK-NEXT: ret i1 [[RES]]
1711+
define <2 x i1> @fcmp_une_sel_x_negx_with_any_fpzero_nnan_vec(<2 x i1> %cond, <2 x float> %x) {
1712+
; CHECK-LABEL: @fcmp_une_sel_x_negx_with_any_fpzero_nnan_vec(
1713+
; CHECK-NEXT: [[ICMP:%.*]] = fcmp nnan une <2 x float> [[X:%.*]], zeroinitializer
1714+
; CHECK-NEXT: ret <2 x i1> [[ICMP]]
17591715
;
1760-
%neg = fneg float %x
1761-
%sel = select i1 %c, float %x, float %neg
1762-
%res = fcmp fast one float %sel, -0.000000e+00
1763-
ret i1 %res
1716+
%fneg = fneg <2 x float> %x
1717+
%sel = select <2 x i1> %cond, <2 x float> %x, <2 x float> %fneg
1718+
%icmp = fcmp nnan une <2 x float> %sel, <float 0.0, float -0.0>
1719+
ret <2 x i1> %icmp
17641720
}

0 commit comments

Comments
 (0)