11
11
12
12
define i1 @t0_const_lshr_shl_ne (i32 %x , i32 %y ) {
13
13
; CHECK-LABEL: @t0_const_lshr_shl_ne(
14
- ; CHECK-NEXT: [[T0:%.*]] = lshr i32 [[X:%.*]], 1
15
- ; CHECK-NEXT: [[T1:%.*]] = shl i32 [[Y:%.*]], 1
16
- ; CHECK-NEXT: [[T2:%.*]] = and i32 [[T1]], [[T0]]
17
- ; CHECK-NEXT: [[T3:%.*]] = icmp ne i32 [[T2]], 0
18
- ; CHECK-NEXT: ret i1 [[T3]]
14
+ ; CHECK-NEXT: [[TMP1:%.*]] = lshr i32 [[X:%.*]], 2
15
+ ; CHECK-NEXT: [[TMP2:%.*]] = and i32 [[TMP1]], [[Y:%.*]]
16
+ ; CHECK-NEXT: [[TMP3:%.*]] = icmp ne i32 [[TMP2]], 0
17
+ ; CHECK-NEXT: ret i1 [[TMP3]]
19
18
;
20
19
%t0 = lshr i32 %x , 1
21
20
%t1 = shl i32 %y , 1
@@ -25,11 +24,10 @@ define i1 @t0_const_lshr_shl_ne(i32 %x, i32 %y) {
25
24
}
26
25
define i1 @t1_const_shl_lshr_ne (i32 %x , i32 %y ) {
27
26
; CHECK-LABEL: @t1_const_shl_lshr_ne(
28
- ; CHECK-NEXT: [[T0:%.*]] = shl i32 [[X:%.*]], 1
29
- ; CHECK-NEXT: [[T1:%.*]] = lshr i32 [[Y:%.*]], 1
30
- ; CHECK-NEXT: [[T2:%.*]] = and i32 [[T1]], [[T0]]
31
- ; CHECK-NEXT: [[T3:%.*]] = icmp ne i32 [[T2]], 0
32
- ; CHECK-NEXT: ret i1 [[T3]]
27
+ ; CHECK-NEXT: [[TMP1:%.*]] = lshr i32 [[Y:%.*]], 2
28
+ ; CHECK-NEXT: [[TMP2:%.*]] = and i32 [[TMP1]], [[X:%.*]]
29
+ ; CHECK-NEXT: [[TMP3:%.*]] = icmp ne i32 [[TMP2]], 0
30
+ ; CHECK-NEXT: ret i1 [[TMP3]]
33
31
;
34
32
%t0 = shl i32 %x , 1
35
33
%t1 = lshr i32 %y , 1
@@ -41,11 +39,10 @@ define i1 @t1_const_shl_lshr_ne(i32 %x, i32 %y) {
41
39
; We are ok with 'eq' predicate too.
42
40
define i1 @t2_const_lshr_shl_eq (i32 %x , i32 %y ) {
43
41
; CHECK-LABEL: @t2_const_lshr_shl_eq(
44
- ; CHECK-NEXT: [[T0:%.*]] = lshr i32 [[X:%.*]], 1
45
- ; CHECK-NEXT: [[T1:%.*]] = shl i32 [[Y:%.*]], 1
46
- ; CHECK-NEXT: [[T2:%.*]] = and i32 [[T1]], [[T0]]
47
- ; CHECK-NEXT: [[T3:%.*]] = icmp eq i32 [[T2]], 0
48
- ; CHECK-NEXT: ret i1 [[T3]]
42
+ ; CHECK-NEXT: [[TMP1:%.*]] = lshr i32 [[X:%.*]], 2
43
+ ; CHECK-NEXT: [[TMP2:%.*]] = and i32 [[TMP1]], [[Y:%.*]]
44
+ ; CHECK-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP2]], 0
45
+ ; CHECK-NEXT: ret i1 [[TMP3]]
49
46
;
50
47
%t0 = lshr i32 %x , 1
51
48
%t1 = shl i32 %y , 1
@@ -58,13 +55,10 @@ define i1 @t2_const_lshr_shl_eq(i32 %x, i32 %y) {
58
55
59
56
define i1 @t3_const_after_fold_lshr_shl_ne (i32 %x , i32 %y , i32 %len ) {
60
57
; CHECK-LABEL: @t3_const_after_fold_lshr_shl_ne(
61
- ; CHECK-NEXT: [[T0:%.*]] = sub i32 32, [[LEN:%.*]]
62
- ; CHECK-NEXT: [[T1:%.*]] = lshr i32 [[X:%.*]], [[T0]]
63
- ; CHECK-NEXT: [[T2:%.*]] = add i32 [[LEN]], -1
64
- ; CHECK-NEXT: [[T3:%.*]] = shl i32 [[Y:%.*]], [[T2]]
65
- ; CHECK-NEXT: [[T4:%.*]] = and i32 [[T1]], [[T3]]
66
- ; CHECK-NEXT: [[T5:%.*]] = icmp ne i32 [[T4]], 0
67
- ; CHECK-NEXT: ret i1 [[T5]]
58
+ ; CHECK-NEXT: [[TMP1:%.*]] = lshr i32 [[X:%.*]], 31
59
+ ; CHECK-NEXT: [[TMP2:%.*]] = and i32 [[TMP1]], [[Y:%.*]]
60
+ ; CHECK-NEXT: [[TMP3:%.*]] = icmp ne i32 [[TMP2]], 0
61
+ ; CHECK-NEXT: ret i1 [[TMP3]]
68
62
;
69
63
%t0 = sub i32 32 , %len
70
64
%t1 = lshr i32 %x , %t0
@@ -76,13 +70,10 @@ define i1 @t3_const_after_fold_lshr_shl_ne(i32 %x, i32 %y, i32 %len) {
76
70
}
77
71
define i1 @t4_const_after_fold_lshr_shl_ne (i32 %x , i32 %y , i32 %len ) {
78
72
; CHECK-LABEL: @t4_const_after_fold_lshr_shl_ne(
79
- ; CHECK-NEXT: [[T0:%.*]] = sub i32 32, [[LEN:%.*]]
80
- ; CHECK-NEXT: [[T1:%.*]] = shl i32 [[X:%.*]], [[T0]]
81
- ; CHECK-NEXT: [[T2:%.*]] = add i32 [[LEN]], -1
82
- ; CHECK-NEXT: [[T3:%.*]] = lshr i32 [[Y:%.*]], [[T2]]
83
- ; CHECK-NEXT: [[T4:%.*]] = and i32 [[T1]], [[T3]]
84
- ; CHECK-NEXT: [[T5:%.*]] = icmp ne i32 [[T4]], 0
85
- ; CHECK-NEXT: ret i1 [[T5]]
73
+ ; CHECK-NEXT: [[TMP1:%.*]] = lshr i32 [[Y:%.*]], 31
74
+ ; CHECK-NEXT: [[TMP2:%.*]] = and i32 [[TMP1]], [[X:%.*]]
75
+ ; CHECK-NEXT: [[TMP3:%.*]] = icmp ne i32 [[TMP2]], 0
76
+ ; CHECK-NEXT: ret i1 [[TMP3]]
86
77
;
87
78
%t0 = sub i32 32 , %len
88
79
%t1 = shl i32 %x , %t0
@@ -128,11 +119,10 @@ define i1 @t6_const_shl_lshr_ne(i32 %x, i32 %y, i32 %shamt0, i32 %shamt1) {
128
119
129
120
define <2 x i1 > @t7_const_lshr_shl_ne_vec_splat (<2 x i32 > %x , <2 x i32 > %y ) {
130
121
; CHECK-LABEL: @t7_const_lshr_shl_ne_vec_splat(
131
- ; CHECK-NEXT: [[T0:%.*]] = lshr <2 x i32> [[X:%.*]], <i32 1, i32 1>
132
- ; CHECK-NEXT: [[T1:%.*]] = shl <2 x i32> [[Y:%.*]], <i32 1, i32 1>
133
- ; CHECK-NEXT: [[T2:%.*]] = and <2 x i32> [[T1]], [[T0]]
134
- ; CHECK-NEXT: [[T3:%.*]] = icmp ne <2 x i32> [[T2]], zeroinitializer
135
- ; CHECK-NEXT: ret <2 x i1> [[T3]]
122
+ ; CHECK-NEXT: [[TMP1:%.*]] = lshr <2 x i32> [[X:%.*]], <i32 2, i32 2>
123
+ ; CHECK-NEXT: [[TMP2:%.*]] = and <2 x i32> [[TMP1]], [[Y:%.*]]
124
+ ; CHECK-NEXT: [[TMP3:%.*]] = icmp ne <2 x i32> [[TMP2]], zeroinitializer
125
+ ; CHECK-NEXT: ret <2 x i1> [[TMP3]]
136
126
;
137
127
%t0 = lshr <2 x i32 > %x , <i32 1 , i32 1 >
138
128
%t1 = shl <2 x i32 > %y , <i32 1 , i32 1 >
@@ -142,11 +132,10 @@ define <2 x i1> @t7_const_lshr_shl_ne_vec_splat(<2 x i32> %x, <2 x i32> %y) {
142
132
}
143
133
define <2 x i1 > @t8_const_lshr_shl_ne_vec_nonsplat (<2 x i32 > %x , <2 x i32 > %y ) {
144
134
; CHECK-LABEL: @t8_const_lshr_shl_ne_vec_nonsplat(
145
- ; CHECK-NEXT: [[T0:%.*]] = lshr <2 x i32> [[X:%.*]], <i32 1, i32 2>
146
- ; CHECK-NEXT: [[T1:%.*]] = shl <2 x i32> [[Y:%.*]], <i32 3, i32 4>
147
- ; CHECK-NEXT: [[T2:%.*]] = and <2 x i32> [[T1]], [[T0]]
148
- ; CHECK-NEXT: [[T3:%.*]] = icmp ne <2 x i32> [[T2]], zeroinitializer
149
- ; CHECK-NEXT: ret <2 x i1> [[T3]]
135
+ ; CHECK-NEXT: [[TMP1:%.*]] = lshr <2 x i32> [[X:%.*]], <i32 4, i32 6>
136
+ ; CHECK-NEXT: [[TMP2:%.*]] = and <2 x i32> [[TMP1]], [[Y:%.*]]
137
+ ; CHECK-NEXT: [[TMP3:%.*]] = icmp ne <2 x i32> [[TMP2]], zeroinitializer
138
+ ; CHECK-NEXT: ret <2 x i1> [[TMP3]]
150
139
;
151
140
%t0 = lshr <2 x i32 > %x , <i32 1 , i32 2 >
152
141
%t1 = shl <2 x i32 > %y , <i32 3 , i32 4 >
@@ -156,11 +145,10 @@ define <2 x i1> @t8_const_lshr_shl_ne_vec_nonsplat(<2 x i32> %x, <2 x i32> %y) {
156
145
}
157
146
define <3 x i1 > @t9_const_lshr_shl_ne_vec_undef0 (<3 x i32 > %x , <3 x i32 > %y ) {
158
147
; CHECK-LABEL: @t9_const_lshr_shl_ne_vec_undef0(
159
- ; CHECK-NEXT: [[T0:%.*]] = lshr <3 x i32> [[X:%.*]], <i32 1, i32 undef, i32 1>
160
- ; CHECK-NEXT: [[T1:%.*]] = shl <3 x i32> [[Y:%.*]], <i32 1, i32 1, i32 1>
161
- ; CHECK-NEXT: [[T2:%.*]] = and <3 x i32> [[T1]], [[T0]]
162
- ; CHECK-NEXT: [[T3:%.*]] = icmp ne <3 x i32> [[T2]], zeroinitializer
163
- ; CHECK-NEXT: ret <3 x i1> [[T3]]
148
+ ; CHECK-NEXT: [[TMP1:%.*]] = lshr <3 x i32> [[X:%.*]], <i32 2, i32 undef, i32 2>
149
+ ; CHECK-NEXT: [[TMP2:%.*]] = and <3 x i32> [[TMP1]], [[Y:%.*]]
150
+ ; CHECK-NEXT: [[TMP3:%.*]] = icmp ne <3 x i32> [[TMP2]], zeroinitializer
151
+ ; CHECK-NEXT: ret <3 x i1> [[TMP3]]
164
152
;
165
153
%t0 = lshr <3 x i32 > %x , <i32 1 , i32 undef , i32 1 >
166
154
%t1 = shl <3 x i32 > %y , <i32 1 , i32 1 , i32 1 >
@@ -170,11 +158,10 @@ define <3 x i1> @t9_const_lshr_shl_ne_vec_undef0(<3 x i32> %x, <3 x i32> %y) {
170
158
}
171
159
define <3 x i1 > @t10_const_lshr_shl_ne_vec_undef1 (<3 x i32 > %x , <3 x i32 > %y ) {
172
160
; CHECK-LABEL: @t10_const_lshr_shl_ne_vec_undef1(
173
- ; CHECK-NEXT: [[T0:%.*]] = lshr <3 x i32> [[X:%.*]], <i32 1, i32 1, i32 1>
174
- ; CHECK-NEXT: [[T1:%.*]] = shl <3 x i32> [[Y:%.*]], <i32 1, i32 undef, i32 1>
175
- ; CHECK-NEXT: [[T2:%.*]] = and <3 x i32> [[T1]], [[T0]]
176
- ; CHECK-NEXT: [[T3:%.*]] = icmp ne <3 x i32> [[T2]], zeroinitializer
177
- ; CHECK-NEXT: ret <3 x i1> [[T3]]
161
+ ; CHECK-NEXT: [[TMP1:%.*]] = lshr <3 x i32> [[X:%.*]], <i32 2, i32 undef, i32 2>
162
+ ; CHECK-NEXT: [[TMP2:%.*]] = and <3 x i32> [[TMP1]], [[Y:%.*]]
163
+ ; CHECK-NEXT: [[TMP3:%.*]] = icmp ne <3 x i32> [[TMP2]], zeroinitializer
164
+ ; CHECK-NEXT: ret <3 x i1> [[TMP3]]
178
165
;
179
166
%t0 = lshr <3 x i32 > %x , <i32 1 , i32 1 , i32 1 >
180
167
%t1 = shl <3 x i32 > %y , <i32 1 , i32 undef , i32 1 >
@@ -184,11 +171,10 @@ define <3 x i1> @t10_const_lshr_shl_ne_vec_undef1(<3 x i32> %x, <3 x i32> %y) {
184
171
}
185
172
define <3 x i1 > @t11_const_lshr_shl_ne_vec_undef2 (<3 x i32 > %x , <3 x i32 > %y ) {
186
173
; CHECK-LABEL: @t11_const_lshr_shl_ne_vec_undef2(
187
- ; CHECK-NEXT: [[T0:%.*]] = lshr <3 x i32> [[X:%.*]], <i32 1, i32 1, i32 1>
188
- ; CHECK-NEXT: [[T1:%.*]] = shl <3 x i32> [[Y:%.*]], <i32 1, i32 1, i32 1>
189
- ; CHECK-NEXT: [[T2:%.*]] = and <3 x i32> [[T1]], [[T0]]
190
- ; CHECK-NEXT: [[T3:%.*]] = icmp ne <3 x i32> [[T2]], <i32 0, i32 undef, i32 0>
191
- ; CHECK-NEXT: ret <3 x i1> [[T3]]
174
+ ; CHECK-NEXT: [[TMP1:%.*]] = lshr <3 x i32> [[X:%.*]], <i32 2, i32 2, i32 2>
175
+ ; CHECK-NEXT: [[TMP2:%.*]] = and <3 x i32> [[TMP1]], [[Y:%.*]]
176
+ ; CHECK-NEXT: [[TMP3:%.*]] = icmp ne <3 x i32> [[TMP2]], zeroinitializer
177
+ ; CHECK-NEXT: ret <3 x i1> [[TMP3]]
192
178
;
193
179
%t0 = lshr <3 x i32 > %x , <i32 1 , i32 1 , i32 1 >
194
180
%t1 = shl <3 x i32 > %y , <i32 1 , i32 1 , i32 1 >
@@ -198,11 +184,10 @@ define <3 x i1> @t11_const_lshr_shl_ne_vec_undef2(<3 x i32> %x, <3 x i32> %y) {
198
184
}
199
185
define <3 x i1 > @t12_const_lshr_shl_ne_vec_undef3 (<3 x i32 > %x , <3 x i32 > %y ) {
200
186
; CHECK-LABEL: @t12_const_lshr_shl_ne_vec_undef3(
201
- ; CHECK-NEXT: [[T0:%.*]] = lshr <3 x i32> [[X:%.*]], <i32 1, i32 undef, i32 1>
202
- ; CHECK-NEXT: [[T1:%.*]] = shl <3 x i32> [[Y:%.*]], <i32 1, i32 undef, i32 1>
203
- ; CHECK-NEXT: [[T2:%.*]] = and <3 x i32> [[T1]], [[T0]]
204
- ; CHECK-NEXT: [[T3:%.*]] = icmp ne <3 x i32> [[T2]], zeroinitializer
205
- ; CHECK-NEXT: ret <3 x i1> [[T3]]
187
+ ; CHECK-NEXT: [[TMP1:%.*]] = lshr <3 x i32> [[X:%.*]], <i32 2, i32 undef, i32 2>
188
+ ; CHECK-NEXT: [[TMP2:%.*]] = and <3 x i32> [[TMP1]], [[Y:%.*]]
189
+ ; CHECK-NEXT: [[TMP3:%.*]] = icmp ne <3 x i32> [[TMP2]], zeroinitializer
190
+ ; CHECK-NEXT: ret <3 x i1> [[TMP3]]
206
191
;
207
192
%t0 = lshr <3 x i32 > %x , <i32 1 , i32 undef , i32 1 >
208
193
%t1 = shl <3 x i32 > %y , <i32 1 , i32 undef , i32 1 >
@@ -212,11 +197,10 @@ define <3 x i1> @t12_const_lshr_shl_ne_vec_undef3(<3 x i32> %x, <3 x i32> %y) {
212
197
}
213
198
define <3 x i1 > @t13_const_lshr_shl_ne_vec_undef4 (<3 x i32 > %x , <3 x i32 > %y ) {
214
199
; CHECK-LABEL: @t13_const_lshr_shl_ne_vec_undef4(
215
- ; CHECK-NEXT: [[T0:%.*]] = lshr <3 x i32> [[X:%.*]], <i32 1, i32 1, i32 1>
216
- ; CHECK-NEXT: [[T1:%.*]] = shl <3 x i32> [[Y:%.*]], <i32 1, i32 undef, i32 1>
217
- ; CHECK-NEXT: [[T2:%.*]] = and <3 x i32> [[T1]], [[T0]]
218
- ; CHECK-NEXT: [[T3:%.*]] = icmp ne <3 x i32> [[T2]], <i32 0, i32 undef, i32 0>
219
- ; CHECK-NEXT: ret <3 x i1> [[T3]]
200
+ ; CHECK-NEXT: [[TMP1:%.*]] = lshr <3 x i32> [[X:%.*]], <i32 2, i32 undef, i32 2>
201
+ ; CHECK-NEXT: [[TMP2:%.*]] = and <3 x i32> [[TMP1]], [[Y:%.*]]
202
+ ; CHECK-NEXT: [[TMP3:%.*]] = icmp ne <3 x i32> [[TMP2]], zeroinitializer
203
+ ; CHECK-NEXT: ret <3 x i1> [[TMP3]]
220
204
;
221
205
%t0 = lshr <3 x i32 > %x , <i32 1 , i32 1 , i32 1 >
222
206
%t1 = shl <3 x i32 > %y , <i32 1 , i32 undef , i32 1 >
@@ -226,11 +210,10 @@ define <3 x i1> @t13_const_lshr_shl_ne_vec_undef4(<3 x i32> %x, <3 x i32> %y) {
226
210
}
227
211
define <3 x i1 > @t14_const_lshr_shl_ne_vec_undef5 (<3 x i32 > %x , <3 x i32 > %y ) {
228
212
; CHECK-LABEL: @t14_const_lshr_shl_ne_vec_undef5(
229
- ; CHECK-NEXT: [[T0:%.*]] = lshr <3 x i32> [[X:%.*]], <i32 1, i32 undef, i32 1>
230
- ; CHECK-NEXT: [[T1:%.*]] = shl <3 x i32> [[Y:%.*]], <i32 1, i32 1, i32 1>
231
- ; CHECK-NEXT: [[T2:%.*]] = and <3 x i32> [[T1]], [[T0]]
232
- ; CHECK-NEXT: [[T3:%.*]] = icmp ne <3 x i32> [[T2]], <i32 0, i32 undef, i32 0>
233
- ; CHECK-NEXT: ret <3 x i1> [[T3]]
213
+ ; CHECK-NEXT: [[TMP1:%.*]] = lshr <3 x i32> [[X:%.*]], <i32 2, i32 undef, i32 2>
214
+ ; CHECK-NEXT: [[TMP2:%.*]] = and <3 x i32> [[TMP1]], [[Y:%.*]]
215
+ ; CHECK-NEXT: [[TMP3:%.*]] = icmp ne <3 x i32> [[TMP2]], zeroinitializer
216
+ ; CHECK-NEXT: ret <3 x i1> [[TMP3]]
234
217
;
235
218
%t0 = lshr <3 x i32 > %x , <i32 1 , i32 undef , i32 1 >
236
219
%t1 = shl <3 x i32 > %y , <i32 1 , i32 1 , i32 1 >
@@ -240,11 +223,10 @@ define <3 x i1> @t14_const_lshr_shl_ne_vec_undef5(<3 x i32> %x, <3 x i32> %y) {
240
223
}
241
224
define <3 x i1 > @t15_const_lshr_shl_ne_vec_undef6 (<3 x i32 > %x , <3 x i32 > %y ) {
242
225
; CHECK-LABEL: @t15_const_lshr_shl_ne_vec_undef6(
243
- ; CHECK-NEXT: [[T0:%.*]] = lshr <3 x i32> [[X:%.*]], <i32 1, i32 undef, i32 1>
244
- ; CHECK-NEXT: [[T1:%.*]] = shl <3 x i32> [[Y:%.*]], <i32 1, i32 undef, i32 1>
245
- ; CHECK-NEXT: [[T2:%.*]] = and <3 x i32> [[T1]], [[T0]]
246
- ; CHECK-NEXT: [[T3:%.*]] = icmp ne <3 x i32> [[T2]], <i32 0, i32 undef, i32 0>
247
- ; CHECK-NEXT: ret <3 x i1> [[T3]]
226
+ ; CHECK-NEXT: [[TMP1:%.*]] = lshr <3 x i32> [[X:%.*]], <i32 2, i32 undef, i32 2>
227
+ ; CHECK-NEXT: [[TMP2:%.*]] = and <3 x i32> [[TMP1]], [[Y:%.*]]
228
+ ; CHECK-NEXT: [[TMP3:%.*]] = icmp ne <3 x i32> [[TMP2]], zeroinitializer
229
+ ; CHECK-NEXT: ret <3 x i1> [[TMP3]]
248
230
;
249
231
%t0 = lshr <3 x i32 > %x , <i32 1 , i32 undef , i32 1 >
250
232
%t1 = shl <3 x i32 > %y , <i32 1 , i32 undef , i32 1 >
@@ -260,11 +242,10 @@ declare i32 @gen32()
260
242
define i1 @t16_commutativity0 (i32 %x ) {
261
243
; CHECK-LABEL: @t16_commutativity0(
262
244
; CHECK-NEXT: [[Y:%.*]] = call i32 @gen32()
263
- ; CHECK-NEXT: [[T0:%.*]] = lshr i32 [[X:%.*]], 1
264
- ; CHECK-NEXT: [[T1:%.*]] = shl i32 [[Y]], 1
265
- ; CHECK-NEXT: [[T2:%.*]] = and i32 [[T1]], [[T0]]
266
- ; CHECK-NEXT: [[T3:%.*]] = icmp ne i32 [[T2]], 0
267
- ; CHECK-NEXT: ret i1 [[T3]]
245
+ ; CHECK-NEXT: [[TMP1:%.*]] = lshr i32 [[X:%.*]], 2
246
+ ; CHECK-NEXT: [[TMP2:%.*]] = and i32 [[TMP1]], [[Y]]
247
+ ; CHECK-NEXT: [[TMP3:%.*]] = icmp ne i32 [[TMP2]], 0
248
+ ; CHECK-NEXT: ret i1 [[TMP3]]
268
249
;
269
250
%y = call i32 @gen32 ()
270
251
%t0 = lshr i32 %x , 1
@@ -277,11 +258,10 @@ define i1 @t16_commutativity0(i32 %x) {
277
258
define i1 @t17_commutativity1 (i32 %y ) {
278
259
; CHECK-LABEL: @t17_commutativity1(
279
260
; CHECK-NEXT: [[X:%.*]] = call i32 @gen32()
280
- ; CHECK-NEXT: [[T0:%.*]] = lshr i32 [[X]], 1
281
- ; CHECK-NEXT: [[T1:%.*]] = shl i32 [[Y:%.*]], 1
282
- ; CHECK-NEXT: [[T2:%.*]] = and i32 [[T0]], [[T1]]
283
- ; CHECK-NEXT: [[T3:%.*]] = icmp ne i32 [[T2]], 0
284
- ; CHECK-NEXT: ret i1 [[T3]]
261
+ ; CHECK-NEXT: [[TMP1:%.*]] = lshr i32 [[X]], 2
262
+ ; CHECK-NEXT: [[TMP2:%.*]] = and i32 [[TMP1]], [[Y:%.*]]
263
+ ; CHECK-NEXT: [[TMP3:%.*]] = icmp ne i32 [[TMP2]], 0
264
+ ; CHECK-NEXT: ret i1 [[TMP3]]
285
265
;
286
266
%x = call i32 @gen32 ()
287
267
%t0 = lshr i32 %x , 1
@@ -299,10 +279,10 @@ define i1 @t18_const_oneuse0(i32 %x, i32 %y) {
299
279
; CHECK-LABEL: @t18_const_oneuse0(
300
280
; CHECK-NEXT: [[T0:%.*]] = lshr i32 [[X:%.*]], 1
301
281
; CHECK-NEXT: call void @use32(i32 [[T0]])
302
- ; CHECK-NEXT: [[T1 :%.*]] = shl i32 [[Y:%.*]], 1
303
- ; CHECK-NEXT: [[T2 :%.*]] = and i32 [[T1 ]], [[T0 ]]
304
- ; CHECK-NEXT: [[T3 :%.*]] = icmp ne i32 [[T2 ]], 0
305
- ; CHECK-NEXT: ret i1 [[T3 ]]
282
+ ; CHECK-NEXT: [[TMP1 :%.*]] = shl i32 [[Y:%.*]], 2
283
+ ; CHECK-NEXT: [[TMP2 :%.*]] = and i32 [[TMP1 ]], [[X ]]
284
+ ; CHECK-NEXT: [[TMP3 :%.*]] = icmp ne i32 [[TMP2 ]], 0
285
+ ; CHECK-NEXT: ret i1 [[TMP3 ]]
306
286
;
307
287
%t0 = lshr i32 %x , 1
308
288
call void @use32 (i32 %t0 )
@@ -313,12 +293,12 @@ define i1 @t18_const_oneuse0(i32 %x, i32 %y) {
313
293
}
314
294
define i1 @t19_const_oneuse1 (i32 %x , i32 %y ) {
315
295
; CHECK-LABEL: @t19_const_oneuse1(
316
- ; CHECK-NEXT: [[T0:%.*]] = lshr i32 [[X:%.*]], 1
317
296
; CHECK-NEXT: [[T1:%.*]] = shl i32 [[Y:%.*]], 1
318
297
; CHECK-NEXT: call void @use32(i32 [[T1]])
319
- ; CHECK-NEXT: [[T2:%.*]] = and i32 [[T1]], [[T0]]
320
- ; CHECK-NEXT: [[T3:%.*]] = icmp ne i32 [[T2]], 0
321
- ; CHECK-NEXT: ret i1 [[T3]]
298
+ ; CHECK-NEXT: [[TMP1:%.*]] = lshr i32 [[X:%.*]], 2
299
+ ; CHECK-NEXT: [[TMP2:%.*]] = and i32 [[TMP1]], [[Y]]
300
+ ; CHECK-NEXT: [[TMP3:%.*]] = icmp ne i32 [[TMP2]], 0
301
+ ; CHECK-NEXT: ret i1 [[TMP3]]
322
302
;
323
303
%t0 = lshr i32 %x , 1
324
304
%t1 = shl i32 %y , 1
@@ -548,10 +528,10 @@ define i1 @t32_commutativity0_oneuse0(i32 %x) {
548
528
; CHECK-NEXT: [[Y:%.*]] = call i32 @gen32()
549
529
; CHECK-NEXT: [[T0:%.*]] = lshr i32 [[X:%.*]], 1
550
530
; CHECK-NEXT: call void @use32(i32 [[T0]])
551
- ; CHECK-NEXT: [[T1 :%.*]] = shl i32 [[Y]], 1
552
- ; CHECK-NEXT: [[T2 :%.*]] = and i32 [[T1 ]], [[T0 ]]
553
- ; CHECK-NEXT: [[T3 :%.*]] = icmp ne i32 [[T2 ]], 0
554
- ; CHECK-NEXT: ret i1 [[T3 ]]
531
+ ; CHECK-NEXT: [[TMP1 :%.*]] = shl i32 [[Y]], 2
532
+ ; CHECK-NEXT: [[TMP2 :%.*]] = and i32 [[TMP1 ]], [[X ]]
533
+ ; CHECK-NEXT: [[TMP3 :%.*]] = icmp ne i32 [[TMP2 ]], 0
534
+ ; CHECK-NEXT: ret i1 [[TMP3 ]]
555
535
;
556
536
%y = call i32 @gen32 ()
557
537
%t0 = lshr i32 %x , 1
@@ -564,12 +544,12 @@ define i1 @t32_commutativity0_oneuse0(i32 %x) {
564
544
define i1 @t33_commutativity0_oneuse1 (i32 %x ) {
565
545
; CHECK-LABEL: @t33_commutativity0_oneuse1(
566
546
; CHECK-NEXT: [[Y:%.*]] = call i32 @gen32()
567
- ; CHECK-NEXT: [[T0:%.*]] = lshr i32 [[X:%.*]], 1
568
547
; CHECK-NEXT: [[T1:%.*]] = shl i32 [[Y]], 1
569
548
; CHECK-NEXT: call void @use32(i32 [[T1]])
570
- ; CHECK-NEXT: [[T2:%.*]] = and i32 [[T1]], [[T0]]
571
- ; CHECK-NEXT: [[T3:%.*]] = icmp ne i32 [[T2]], 0
572
- ; CHECK-NEXT: ret i1 [[T3]]
549
+ ; CHECK-NEXT: [[TMP1:%.*]] = lshr i32 [[X:%.*]], 2
550
+ ; CHECK-NEXT: [[TMP2:%.*]] = and i32 [[TMP1]], [[Y]]
551
+ ; CHECK-NEXT: [[TMP3:%.*]] = icmp ne i32 [[TMP2]], 0
552
+ ; CHECK-NEXT: ret i1 [[TMP3]]
573
553
;
574
554
%y = call i32 @gen32 ()
575
555
%t0 = lshr i32 %x , 1
@@ -585,10 +565,10 @@ define i1 @t34_commutativity1_oneuse0(i32 %y) {
585
565
; CHECK-NEXT: [[X:%.*]] = call i32 @gen32()
586
566
; CHECK-NEXT: [[T0:%.*]] = lshr i32 [[X]], 1
587
567
; CHECK-NEXT: call void @use32(i32 [[T0]])
588
- ; CHECK-NEXT: [[T1 :%.*]] = shl i32 [[Y:%.*]], 1
589
- ; CHECK-NEXT: [[T2 :%.*]] = and i32 [[T0 ]], [[T1 ]]
590
- ; CHECK-NEXT: [[T3 :%.*]] = icmp ne i32 [[T2 ]], 0
591
- ; CHECK-NEXT: ret i1 [[T3 ]]
568
+ ; CHECK-NEXT: [[TMP1 :%.*]] = shl i32 [[Y:%.*]], 2
569
+ ; CHECK-NEXT: [[TMP2 :%.*]] = and i32 [[TMP1 ]], [[X ]]
570
+ ; CHECK-NEXT: [[TMP3 :%.*]] = icmp ne i32 [[TMP2 ]], 0
571
+ ; CHECK-NEXT: ret i1 [[TMP3 ]]
592
572
;
593
573
%x = call i32 @gen32 ()
594
574
%t0 = lshr i32 %x , 1
@@ -601,12 +581,12 @@ define i1 @t34_commutativity1_oneuse0(i32 %y) {
601
581
define i1 @t35_commutativity1_oneuse1 (i32 %y ) {
602
582
; CHECK-LABEL: @t35_commutativity1_oneuse1(
603
583
; CHECK-NEXT: [[X:%.*]] = call i32 @gen32()
604
- ; CHECK-NEXT: [[T0:%.*]] = lshr i32 [[X]], 1
605
584
; CHECK-NEXT: [[T1:%.*]] = shl i32 [[Y:%.*]], 1
606
585
; CHECK-NEXT: call void @use32(i32 [[T1]])
607
- ; CHECK-NEXT: [[T2:%.*]] = and i32 [[T0]], [[T1]]
608
- ; CHECK-NEXT: [[T3:%.*]] = icmp ne i32 [[T2]], 0
609
- ; CHECK-NEXT: ret i1 [[T3]]
586
+ ; CHECK-NEXT: [[TMP1:%.*]] = lshr i32 [[X]], 2
587
+ ; CHECK-NEXT: [[TMP2:%.*]] = and i32 [[TMP1]], [[Y]]
588
+ ; CHECK-NEXT: [[TMP3:%.*]] = icmp ne i32 [[TMP2]], 0
589
+ ; CHECK-NEXT: ret i1 [[TMP3]]
610
590
;
611
591
%x = call i32 @gen32 ()
612
592
%t0 = lshr i32 %x , 1
0 commit comments