@@ -7,8 +7,7 @@ declare void @use(i8)
7
7
8
8
define i1 @slt_positive_multip_rem_zero (i8 %x ) {
9
9
; CHECK-LABEL: @slt_positive_multip_rem_zero(
10
- ; CHECK-NEXT: [[A:%.*]] = mul nsw i8 [[X:%.*]], 7
11
- ; CHECK-NEXT: [[B:%.*]] = icmp slt i8 [[A]], 21
10
+ ; CHECK-NEXT: [[B:%.*]] = icmp slt i8 [[X:%.*]], 3
12
11
; CHECK-NEXT: ret i1 [[B]]
13
12
;
14
13
%a = mul nsw i8 %x , 7
@@ -18,8 +17,7 @@ define i1 @slt_positive_multip_rem_zero(i8 %x) {
18
17
19
18
define i1 @slt_negative_multip_rem_zero (i8 %x ) {
20
19
; CHECK-LABEL: @slt_negative_multip_rem_zero(
21
- ; CHECK-NEXT: [[A:%.*]] = mul nsw i8 [[X:%.*]], -7
22
- ; CHECK-NEXT: [[B:%.*]] = icmp slt i8 [[A]], 21
20
+ ; CHECK-NEXT: [[B:%.*]] = icmp sgt i8 [[X:%.*]], -3
23
21
; CHECK-NEXT: ret i1 [[B]]
24
22
;
25
23
%a = mul nsw i8 %x , -7
@@ -29,8 +27,7 @@ define i1 @slt_negative_multip_rem_zero(i8 %x) {
29
27
30
28
define i1 @slt_positive_multip_rem_nz (i8 %x ) {
31
29
; CHECK-LABEL: @slt_positive_multip_rem_nz(
32
- ; CHECK-NEXT: [[A:%.*]] = mul nsw i8 [[X:%.*]], 5
33
- ; CHECK-NEXT: [[B:%.*]] = icmp slt i8 [[A]], 21
30
+ ; CHECK-NEXT: [[B:%.*]] = icmp slt i8 [[X:%.*]], 5
34
31
; CHECK-NEXT: ret i1 [[B]]
35
32
;
36
33
%a = mul nsw i8 %x , 5
@@ -40,8 +37,7 @@ define i1 @slt_positive_multip_rem_nz(i8 %x) {
40
37
41
38
define i1 @ult_rem_zero (i8 %x ) {
42
39
; CHECK-LABEL: @ult_rem_zero(
43
- ; CHECK-NEXT: [[A:%.*]] = mul nuw i8 [[X:%.*]], 7
44
- ; CHECK-NEXT: [[B:%.*]] = icmp ult i8 [[A]], 21
40
+ ; CHECK-NEXT: [[B:%.*]] = icmp ult i8 [[X:%.*]], 3
45
41
; CHECK-NEXT: ret i1 [[B]]
46
42
;
47
43
%a = mul nuw i8 %x , 7
@@ -51,8 +47,7 @@ define i1 @ult_rem_zero(i8 %x) {
51
47
52
48
define i1 @ult_rem_nz (i8 %x ) {
53
49
; CHECK-LABEL: @ult_rem_nz(
54
- ; CHECK-NEXT: [[A:%.*]] = mul nuw i8 [[X:%.*]], 5
55
- ; CHECK-NEXT: [[B:%.*]] = icmp ult i8 [[A]], 21
50
+ ; CHECK-NEXT: [[B:%.*]] = icmp ult i8 [[X:%.*]], 5
56
51
; CHECK-NEXT: ret i1 [[B]]
57
52
;
58
53
%a = mul nuw i8 %x , 5
@@ -64,8 +59,7 @@ define i1 @ult_rem_nz(i8 %x) {
64
59
65
60
define i1 @sgt_positive_multip_rem_zero (i8 %x ) {
66
61
; CHECK-LABEL: @sgt_positive_multip_rem_zero(
67
- ; CHECK-NEXT: [[A:%.*]] = mul nsw i8 [[X:%.*]], 7
68
- ; CHECK-NEXT: [[B:%.*]] = icmp sgt i8 [[A]], 21
62
+ ; CHECK-NEXT: [[B:%.*]] = icmp sgt i8 [[X:%.*]], 3
69
63
; CHECK-NEXT: ret i1 [[B]]
70
64
;
71
65
%a = mul nsw i8 %x , 7
@@ -75,8 +69,7 @@ define i1 @sgt_positive_multip_rem_zero(i8 %x) {
75
69
76
70
define i1 @sgt_negative_multip_rem_zero (i8 %x ) {
77
71
; CHECK-LABEL: @sgt_negative_multip_rem_zero(
78
- ; CHECK-NEXT: [[A:%.*]] = mul nsw i8 [[X:%.*]], -7
79
- ; CHECK-NEXT: [[B:%.*]] = icmp sgt i8 [[A]], 21
72
+ ; CHECK-NEXT: [[B:%.*]] = icmp slt i8 [[X:%.*]], -3
80
73
; CHECK-NEXT: ret i1 [[B]]
81
74
;
82
75
%a = mul nsw i8 %x , -7
@@ -86,8 +79,7 @@ define i1 @sgt_negative_multip_rem_zero(i8 %x) {
86
79
87
80
define i1 @sgt_positive_multip_rem_nz (i8 %x ) {
88
81
; CHECK-LABEL: @sgt_positive_multip_rem_nz(
89
- ; CHECK-NEXT: [[A:%.*]] = mul nsw i8 [[X:%.*]], 5
90
- ; CHECK-NEXT: [[B:%.*]] = icmp sgt i8 [[A]], 21
82
+ ; CHECK-NEXT: [[B:%.*]] = icmp sgt i8 [[X:%.*]], 4
91
83
; CHECK-NEXT: ret i1 [[B]]
92
84
;
93
85
%a = mul nsw i8 %x , 5
@@ -97,8 +89,7 @@ define i1 @sgt_positive_multip_rem_nz(i8 %x) {
97
89
98
90
define i1 @ugt_rem_zero (i8 %x ) {
99
91
; CHECK-LABEL: @ugt_rem_zero(
100
- ; CHECK-NEXT: [[A:%.*]] = mul nuw i8 [[X:%.*]], 7
101
- ; CHECK-NEXT: [[B:%.*]] = icmp ugt i8 [[A]], 21
92
+ ; CHECK-NEXT: [[B:%.*]] = icmp ugt i8 [[X:%.*]], 3
102
93
; CHECK-NEXT: ret i1 [[B]]
103
94
;
104
95
%a = mul nuw i8 %x , 7
@@ -108,8 +99,7 @@ define i1 @ugt_rem_zero(i8 %x) {
108
99
109
100
define i1 @ugt_rem_nz (i8 %x ) {
110
101
; CHECK-LABEL: @ugt_rem_nz(
111
- ; CHECK-NEXT: [[A:%.*]] = mul nuw i8 [[X:%.*]], 5
112
- ; CHECK-NEXT: [[B:%.*]] = icmp ugt i8 [[A]], 21
102
+ ; CHECK-NEXT: [[B:%.*]] = icmp ugt i8 [[X:%.*]], 4
113
103
; CHECK-NEXT: ret i1 [[B]]
114
104
;
115
105
%a = mul nuw i8 %x , 5
@@ -866,13 +856,11 @@ define i1 @splat_mul_known_lz(i32 %x) {
866
856
ret i1 %r
867
857
}
868
858
869
- ; Negative test - the 33rd bit could be set.
859
+ ; The 33rd bit can only be set when MSB of x is set.
870
860
871
861
define i1 @splat_mul_unknown_lz (i32 %x ) {
872
862
; CHECK-LABEL: @splat_mul_unknown_lz(
873
- ; CHECK-NEXT: [[Z:%.*]] = zext i32 [[X:%.*]] to i128
874
- ; CHECK-NEXT: [[M:%.*]] = mul nuw nsw i128 [[Z]], 18446744078004518913
875
- ; CHECK-NEXT: [[R:%.*]] = icmp ult i128 [[M]], 39614081257132168796771975168
863
+ ; CHECK-NEXT: [[R:%.*]] = icmp sgt i32 [[X:%.*]], -1
876
864
; CHECK-NEXT: ret i1 [[R]]
877
865
;
878
866
%z = zext i32 %x to i128
0 commit comments