@@ -10,16 +10,18 @@ type TwoTuple = (i16, u16);
1010//
1111// The operators are all overridden directly, so should optimize easily.
1212//
13- // Yes, the `s[lg]t` is correct for the `[lg]e` version because it's only used
14- // in the side of the select where we know the values are *not* equal.
13+ // slt-vs-sle and sgt-vs-sge don't matter because they're only used in the side
14+ // of the select where we know the values are not equal, and thus the tests
15+ // use a regex to allow either, since unimportant changes to the implementation
16+ // sometimes result in changing what LLVM decides to emit for this.
1517//
1618
1719// CHECK-LABEL: @check_lt_direct
1820// CHECK-SAME: (i16 noundef %[[A0:.+]], i16 noundef %[[A1:.+]], i16 noundef %[[B0:.+]], i16 noundef %[[B1:.+]])
1921#[ no_mangle]
2022pub fn check_lt_direct ( a : TwoTuple , b : TwoTuple ) -> bool {
2123 // CHECK-DAG: %[[EQ:.+]] = icmp eq i16 %[[A0]], %[[B0]]
22- // CHECK-DAG: %[[CMP0:.+]] = icmp slt i16 %[[A0]], %[[B0]]
24+ // CHECK-DAG: %[[CMP0:.+]] = icmp {{ slt|sle}} i16 %[[A0]], %[[B0]]
2325 // CHECK-DAG: %[[CMP1:.+]] = icmp ult i16 %[[A1]], %[[B1]]
2426 // CHECK: %[[R:.+]] = select i1 %[[EQ]], i1 %[[CMP1]], i1 %[[CMP0]]
2527 // CHECK: ret i1 %[[R]]
@@ -31,7 +33,7 @@ pub fn check_lt_direct(a: TwoTuple, b: TwoTuple) -> bool {
3133#[ no_mangle]
3234pub fn check_le_direct ( a : TwoTuple , b : TwoTuple ) -> bool {
3335 // CHECK-DAG: %[[EQ:.+]] = icmp eq i16 %[[A0]], %[[B0]]
34- // CHECK-DAG: %[[CMP0:.+]] = icmp slt i16 %[[A0]], %[[B0]]
36+ // CHECK-DAG: %[[CMP0:.+]] = icmp {{ slt|sle}} i16 %[[A0]], %[[B0]]
3537 // CHECK-DAG: %[[CMP1:.+]] = icmp ule i16 %[[A1]], %[[B1]]
3638 // CHECK: %[[R:.+]] = select i1 %[[EQ]], i1 %[[CMP1]], i1 %[[CMP0]]
3739 // CHECK: ret i1 %[[R]]
@@ -43,7 +45,7 @@ pub fn check_le_direct(a: TwoTuple, b: TwoTuple) -> bool {
4345#[ no_mangle]
4446pub fn check_gt_direct ( a : TwoTuple , b : TwoTuple ) -> bool {
4547 // CHECK-DAG: %[[EQ:.+]] = icmp eq i16 %[[A0]], %[[B0]]
46- // CHECK-DAG: %[[CMP0:.+]] = icmp sgt i16 %[[A0]], %[[B0]]
48+ // CHECK-DAG: %[[CMP0:.+]] = icmp {{ sgt|sge}} i16 %[[A0]], %[[B0]]
4749 // CHECK-DAG: %[[CMP1:.+]] = icmp ugt i16 %[[A1]], %[[B1]]
4850 // CHECK: %[[R:.+]] = select i1 %[[EQ]], i1 %[[CMP1]], i1 %[[CMP0]]
4951 // CHECK: ret i1 %[[R]]
@@ -55,7 +57,7 @@ pub fn check_gt_direct(a: TwoTuple, b: TwoTuple) -> bool {
5557#[ no_mangle]
5658pub fn check_ge_direct ( a : TwoTuple , b : TwoTuple ) -> bool {
5759 // CHECK-DAG: %[[EQ:.+]] = icmp eq i16 %[[A0]], %[[B0]]
58- // CHECK-DAG: %[[CMP0:.+]] = icmp sgt i16 %[[A0]], %[[B0]]
60+ // CHECK-DAG: %[[CMP0:.+]] = icmp {{ sgt|sge}} i16 %[[A0]], %[[B0]]
5961 // CHECK-DAG: %[[CMP1:.+]] = icmp uge i16 %[[A1]], %[[B1]]
6062 // CHECK: %[[R:.+]] = select i1 %[[EQ]], i1 %[[CMP1]], i1 %[[CMP0]]
6163 // CHECK: ret i1 %[[R]]
0 commit comments