@@ -10,16 +10,18 @@ type TwoTuple = (i16, u16);
10
10
//
11
11
// The operators are all overridden directly, so should optimize easily.
12
12
//
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.
15
17
//
16
18
17
19
// CHECK-LABEL: @check_lt_direct
18
20
// CHECK-SAME: (i16 noundef %[[A0:.+]], i16 noundef %[[A1:.+]], i16 noundef %[[B0:.+]], i16 noundef %[[B1:.+]])
19
21
#[ no_mangle]
20
22
pub fn check_lt_direct ( a : TwoTuple , b : TwoTuple ) -> bool {
21
23
// 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]]
23
25
// CHECK-DAG: %[[CMP1:.+]] = icmp ult i16 %[[A1]], %[[B1]]
24
26
// CHECK: %[[R:.+]] = select i1 %[[EQ]], i1 %[[CMP1]], i1 %[[CMP0]]
25
27
// CHECK: ret i1 %[[R]]
@@ -31,7 +33,7 @@ pub fn check_lt_direct(a: TwoTuple, b: TwoTuple) -> bool {
31
33
#[ no_mangle]
32
34
pub fn check_le_direct ( a : TwoTuple , b : TwoTuple ) -> bool {
33
35
// 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]]
35
37
// CHECK-DAG: %[[CMP1:.+]] = icmp ule i16 %[[A1]], %[[B1]]
36
38
// CHECK: %[[R:.+]] = select i1 %[[EQ]], i1 %[[CMP1]], i1 %[[CMP0]]
37
39
// CHECK: ret i1 %[[R]]
@@ -43,7 +45,7 @@ pub fn check_le_direct(a: TwoTuple, b: TwoTuple) -> bool {
43
45
#[ no_mangle]
44
46
pub fn check_gt_direct ( a : TwoTuple , b : TwoTuple ) -> bool {
45
47
// 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]]
47
49
// CHECK-DAG: %[[CMP1:.+]] = icmp ugt i16 %[[A1]], %[[B1]]
48
50
// CHECK: %[[R:.+]] = select i1 %[[EQ]], i1 %[[CMP1]], i1 %[[CMP0]]
49
51
// CHECK: ret i1 %[[R]]
@@ -55,7 +57,7 @@ pub fn check_gt_direct(a: TwoTuple, b: TwoTuple) -> bool {
55
57
#[ no_mangle]
56
58
pub fn check_ge_direct ( a : TwoTuple , b : TwoTuple ) -> bool {
57
59
// 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]]
59
61
// CHECK-DAG: %[[CMP1:.+]] = icmp uge i16 %[[A1]], %[[B1]]
60
62
// CHECK: %[[R:.+]] = select i1 %[[EQ]], i1 %[[CMP1]], i1 %[[CMP0]]
61
63
// CHECK: ret i1 %[[R]]
0 commit comments