3
3
4
4
define i32 @ashr_lshr_exact_ashr_only (i32 %x , i32 %y ) {
5
5
; CHECK-LABEL: @ashr_lshr_exact_ashr_only(
6
- ; CHECK-NEXT: [[CMP1 :%.*]] = ashr i32 [[X:%.*]], [[Y:%.*]]
7
- ; CHECK-NEXT: ret i32 [[CMP1 ]]
6
+ ; CHECK-NEXT: [[CMP12 :%.*]] = ashr i32 [[X:%.*]], [[Y:%.*]]
7
+ ; CHECK-NEXT: ret i32 [[CMP12 ]]
8
8
;
9
9
%cmp = icmp sgt i32 %x , -1
10
10
%l = lshr i32 %x , %y
@@ -15,8 +15,8 @@ define i32 @ashr_lshr_exact_ashr_only(i32 %x, i32 %y) {
15
15
16
16
define i32 @ashr_lshr_no_exact (i32 %x , i32 %y ) {
17
17
; CHECK-LABEL: @ashr_lshr_no_exact(
18
- ; CHECK-NEXT: [[CMP1 :%.*]] = ashr i32 [[X:%.*]], [[Y:%.*]]
19
- ; CHECK-NEXT: ret i32 [[CMP1 ]]
18
+ ; CHECK-NEXT: [[CMP12 :%.*]] = ashr i32 [[X:%.*]], [[Y:%.*]]
19
+ ; CHECK-NEXT: ret i32 [[CMP12 ]]
20
20
;
21
21
%cmp = icmp sgt i32 %x , -1
22
22
%l = lshr i32 %x , %y
@@ -27,8 +27,8 @@ define i32 @ashr_lshr_no_exact(i32 %x, i32 %y) {
27
27
28
28
define i32 @ashr_lshr_exact_both (i32 %x , i32 %y ) {
29
29
; CHECK-LABEL: @ashr_lshr_exact_both(
30
- ; CHECK-NEXT: [[CMP1 :%.*]] = ashr exact i32 [[X:%.*]], [[Y:%.*]]
31
- ; CHECK-NEXT: ret i32 [[CMP1 ]]
30
+ ; CHECK-NEXT: [[CMP12 :%.*]] = ashr exact i32 [[X:%.*]], [[Y:%.*]]
31
+ ; CHECK-NEXT: ret i32 [[CMP12 ]]
32
32
;
33
33
%cmp = icmp sgt i32 %x , -1
34
34
%l = lshr exact i32 %x , %y
@@ -39,8 +39,8 @@ define i32 @ashr_lshr_exact_both(i32 %x, i32 %y) {
39
39
40
40
define i32 @ashr_lshr_exact_lshr_only (i32 %x , i32 %y ) {
41
41
; CHECK-LABEL: @ashr_lshr_exact_lshr_only(
42
- ; CHECK-NEXT: [[CMP1 :%.*]] = ashr i32 [[X:%.*]], [[Y:%.*]]
43
- ; CHECK-NEXT: ret i32 [[CMP1 ]]
42
+ ; CHECK-NEXT: [[CMP12 :%.*]] = ashr i32 [[X:%.*]], [[Y:%.*]]
43
+ ; CHECK-NEXT: ret i32 [[CMP12 ]]
44
44
;
45
45
%cmp = icmp sgt i32 %x , -1
46
46
%l = lshr exact i32 %x , %y
@@ -63,8 +63,8 @@ define i32 @ashr_lshr2(i32 %x, i32 %y) {
63
63
64
64
define <2 x i32 > @ashr_lshr_splat_vec (<2 x i32 > %x , <2 x i32 > %y ) {
65
65
; CHECK-LABEL: @ashr_lshr_splat_vec(
66
- ; CHECK-NEXT: [[CMP1 :%.*]] = ashr <2 x i32> [[X:%.*]], [[Y:%.*]]
67
- ; CHECK-NEXT: ret <2 x i32> [[CMP1 ]]
66
+ ; CHECK-NEXT: [[CMP12 :%.*]] = ashr <2 x i32> [[X:%.*]], [[Y:%.*]]
67
+ ; CHECK-NEXT: ret <2 x i32> [[CMP12 ]]
68
68
;
69
69
%cmp = icmp sgt <2 x i32 > %x , <i32 -1 , i32 -1 >
70
70
%l = lshr <2 x i32 > %x , %y
@@ -75,8 +75,8 @@ define <2 x i32> @ashr_lshr_splat_vec(<2 x i32> %x, <2 x i32> %y) {
75
75
76
76
define <2 x i32 > @ashr_lshr_splat_vec2 (<2 x i32 > %x , <2 x i32 > %y ) {
77
77
; CHECK-LABEL: @ashr_lshr_splat_vec2(
78
- ; CHECK-NEXT: [[CMP1 :%.*]] = ashr exact <2 x i32> [[X:%.*]], [[Y:%.*]]
79
- ; CHECK-NEXT: ret <2 x i32> [[CMP1 ]]
78
+ ; CHECK-NEXT: [[CMP12 :%.*]] = ashr exact <2 x i32> [[X:%.*]], [[Y:%.*]]
79
+ ; CHECK-NEXT: ret <2 x i32> [[CMP12 ]]
80
80
;
81
81
%cmp = icmp sgt <2 x i32 > %x , <i32 -1 , i32 -1 >
82
82
%l = lshr exact <2 x i32 > %x , %y
@@ -87,8 +87,8 @@ define <2 x i32> @ashr_lshr_splat_vec2(<2 x i32> %x, <2 x i32> %y) {
87
87
88
88
define <2 x i32 > @ashr_lshr_splat_vec3 (<2 x i32 > %x , <2 x i32 > %y ) {
89
89
; CHECK-LABEL: @ashr_lshr_splat_vec3(
90
- ; CHECK-NEXT: [[CMP1 :%.*]] = ashr <2 x i32> [[X:%.*]], [[Y:%.*]]
91
- ; CHECK-NEXT: ret <2 x i32> [[CMP1 ]]
90
+ ; CHECK-NEXT: [[CMP12 :%.*]] = ashr <2 x i32> [[X:%.*]], [[Y:%.*]]
91
+ ; CHECK-NEXT: ret <2 x i32> [[CMP12 ]]
92
92
;
93
93
%cmp = icmp sgt <2 x i32 > %x , <i32 -1 , i32 -1 >
94
94
%l = lshr exact <2 x i32 > %x , %y
@@ -99,8 +99,8 @@ define <2 x i32> @ashr_lshr_splat_vec3(<2 x i32> %x, <2 x i32> %y) {
99
99
100
100
define <2 x i32 > @ashr_lshr_splat_vec4 (<2 x i32 > %x , <2 x i32 > %y ) {
101
101
; CHECK-LABEL: @ashr_lshr_splat_vec4(
102
- ; CHECK-NEXT: [[CMP1 :%.*]] = ashr <2 x i32> [[X:%.*]], [[Y:%.*]]
103
- ; CHECK-NEXT: ret <2 x i32> [[CMP1 ]]
102
+ ; CHECK-NEXT: [[CMP12 :%.*]] = ashr <2 x i32> [[X:%.*]], [[Y:%.*]]
103
+ ; CHECK-NEXT: ret <2 x i32> [[CMP12 ]]
104
104
;
105
105
%cmp = icmp sgt <2 x i32 > %x , <i32 -1 , i32 -1 >
106
106
%l = lshr <2 x i32 > %x , %y
@@ -171,8 +171,8 @@ define i32 @ashr_lshr_cst(i32 %x, i32 %y) {
171
171
172
172
define i32 @ashr_lshr_cst2 (i32 %x , i32 %y ) {
173
173
; CHECK-LABEL: @ashr_lshr_cst2(
174
- ; CHECK-NEXT: [[CMP1 :%.*]] = ashr i32 [[X:%.*]], 8
175
- ; CHECK-NEXT: ret i32 [[CMP1 ]]
174
+ ; CHECK-NEXT: [[CMP12 :%.*]] = ashr i32 [[X:%.*]], 8
175
+ ; CHECK-NEXT: ret i32 [[CMP12 ]]
176
176
;
177
177
%cmp = icmp sgt i32 %x , -1
178
178
%l = lshr i32 %x , 8
@@ -231,8 +231,8 @@ define <2 x i32> @ashr_lshr_inv_nonsplat_vec(<2 x i32> %x, <2 x i32> %y) {
231
231
232
232
define <2 x i32 > @ashr_lshr_vec_undef (<2 x i32 > %x , <2 x i32 > %y ) {
233
233
; CHECK-LABEL: @ashr_lshr_vec_undef(
234
- ; CHECK-NEXT: [[CMP1 :%.*]] = ashr <2 x i32> [[X:%.*]], [[Y:%.*]]
235
- ; CHECK-NEXT: ret <2 x i32> [[CMP1 ]]
234
+ ; CHECK-NEXT: [[CMP12 :%.*]] = ashr <2 x i32> [[X:%.*]], [[Y:%.*]]
235
+ ; CHECK-NEXT: ret <2 x i32> [[CMP12 ]]
236
236
;
237
237
%cmp = icmp sgt <2 x i32 > %x , <i32 undef , i32 -1 >
238
238
%l = lshr <2 x i32 > %x , %y
@@ -317,10 +317,10 @@ define i32 @ashr_lshr_shift_wrong_pred(i32 %x, i32 %y, i32 %z) {
317
317
318
318
define i32 @ashr_lshr_shift_wrong_pred2 (i32 %x , i32 %y , i32 %z ) {
319
319
; CHECK-LABEL: @ashr_lshr_shift_wrong_pred2(
320
- ; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[Z:%.*]], -1
321
320
; CHECK-NEXT: [[L:%.*]] = lshr i32 [[X:%.*]], [[Y:%.*]]
322
321
; CHECK-NEXT: [[R:%.*]] = ashr i32 [[X]], [[Y]]
323
- ; CHECK-NEXT: [[RET:%.*]] = select i1 [[CMP]], i32 [[L]], i32 [[R]]
322
+ ; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i32 [[Z:%.*]], 0
323
+ ; CHECK-NEXT: [[RET:%.*]] = select i1 [[CMP1]], i32 [[R]], i32 [[L]]
324
324
; CHECK-NEXT: ret i32 [[RET]]
325
325
;
326
326
%cmp = icmp sge i32 %z , 0
@@ -332,10 +332,10 @@ define i32 @ashr_lshr_shift_wrong_pred2(i32 %x, i32 %y, i32 %z) {
332
332
333
333
define i32 @ashr_lshr_wrong_operands (i32 %x , i32 %y ) {
334
334
; CHECK-LABEL: @ashr_lshr_wrong_operands(
335
- ; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[X:%.*]], -1
336
- ; CHECK-NEXT: [[L:%.*]] = lshr i32 [[X]], [[Y:%.*]]
335
+ ; CHECK-NEXT: [[L:%.*]] = lshr i32 [[X:%.*]], [[Y:%.*]]
337
336
; CHECK-NEXT: [[R:%.*]] = ashr i32 [[X]], [[Y]]
338
- ; CHECK-NEXT: [[RET:%.*]] = select i1 [[CMP]], i32 [[R]], i32 [[L]]
337
+ ; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i32 [[X]], 0
338
+ ; CHECK-NEXT: [[RET:%.*]] = select i1 [[CMP1]], i32 [[L]], i32 [[R]]
339
339
; CHECK-NEXT: ret i32 [[RET]]
340
340
;
341
341
%cmp = icmp sge i32 %x , 0
@@ -347,10 +347,10 @@ define i32 @ashr_lshr_wrong_operands(i32 %x, i32 %y) {
347
347
348
348
define i32 @ashr_lshr_no_ashr (i32 %x , i32 %y ) {
349
349
; CHECK-LABEL: @ashr_lshr_no_ashr(
350
- ; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[X:%.*]], -1
351
- ; CHECK-NEXT: [[L:%.*]] = lshr i32 [[X]], [[Y:%.*]]
350
+ ; CHECK-NEXT: [[L:%.*]] = lshr i32 [[X:%.*]], [[Y:%.*]]
352
351
; CHECK-NEXT: [[R:%.*]] = xor i32 [[X]], [[Y]]
353
- ; CHECK-NEXT: [[RET:%.*]] = select i1 [[CMP]], i32 [[L]], i32 [[R]]
352
+ ; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i32 [[X]], 0
353
+ ; CHECK-NEXT: [[RET:%.*]] = select i1 [[CMP1]], i32 [[R]], i32 [[L]]
354
354
; CHECK-NEXT: ret i32 [[RET]]
355
355
;
356
356
%cmp = icmp sge i32 %x , 0
@@ -362,10 +362,10 @@ define i32 @ashr_lshr_no_ashr(i32 %x, i32 %y) {
362
362
363
363
define i32 @ashr_lshr_shift_amt_mismatch (i32 %x , i32 %y , i32 %z ) {
364
364
; CHECK-LABEL: @ashr_lshr_shift_amt_mismatch(
365
- ; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[X:%.*]], -1
366
- ; CHECK-NEXT: [[L:%.*]] = lshr i32 [[X]], [[Y:%.*]]
365
+ ; CHECK-NEXT: [[L:%.*]] = lshr i32 [[X:%.*]], [[Y:%.*]]
367
366
; CHECK-NEXT: [[R:%.*]] = ashr i32 [[X]], [[Z:%.*]]
368
- ; CHECK-NEXT: [[RET:%.*]] = select i1 [[CMP]], i32 [[L]], i32 [[R]]
367
+ ; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i32 [[X]], 0
368
+ ; CHECK-NEXT: [[RET:%.*]] = select i1 [[CMP1]], i32 [[R]], i32 [[L]]
369
369
; CHECK-NEXT: ret i32 [[RET]]
370
370
;
371
371
%cmp = icmp sge i32 %x , 0
@@ -377,10 +377,10 @@ define i32 @ashr_lshr_shift_amt_mismatch(i32 %x, i32 %y, i32 %z) {
377
377
378
378
define i32 @ashr_lshr_shift_base_mismatch (i32 %x , i32 %y , i32 %z ) {
379
379
; CHECK-LABEL: @ashr_lshr_shift_base_mismatch(
380
- ; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[X:%.*]], -1
381
- ; CHECK-NEXT: [[L:%.*]] = lshr i32 [[X]], [[Y:%.*]]
380
+ ; CHECK-NEXT: [[L:%.*]] = lshr i32 [[X:%.*]], [[Y:%.*]]
382
381
; CHECK-NEXT: [[R:%.*]] = ashr i32 [[Z:%.*]], [[Y]]
383
- ; CHECK-NEXT: [[RET:%.*]] = select i1 [[CMP]], i32 [[L]], i32 [[R]]
382
+ ; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i32 [[X]], 0
383
+ ; CHECK-NEXT: [[RET:%.*]] = select i1 [[CMP1]], i32 [[R]], i32 [[L]]
384
384
; CHECK-NEXT: ret i32 [[RET]]
385
385
;
386
386
%cmp = icmp sge i32 %x , 0
@@ -392,10 +392,10 @@ define i32 @ashr_lshr_shift_base_mismatch(i32 %x, i32 %y, i32 %z) {
392
392
393
393
define i32 @ashr_lshr_no_lshr (i32 %x , i32 %y ) {
394
394
; CHECK-LABEL: @ashr_lshr_no_lshr(
395
- ; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[X:%.*]], -1
396
- ; CHECK-NEXT: [[L:%.*]] = add i32 [[X]], [[Y:%.*]]
395
+ ; CHECK-NEXT: [[L:%.*]] = add i32 [[X:%.*]], [[Y:%.*]]
397
396
; CHECK-NEXT: [[R:%.*]] = ashr i32 [[X]], [[Y]]
398
- ; CHECK-NEXT: [[RET:%.*]] = select i1 [[CMP]], i32 [[L]], i32 [[R]]
397
+ ; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i32 [[X]], 0
398
+ ; CHECK-NEXT: [[RET:%.*]] = select i1 [[CMP1]], i32 [[R]], i32 [[L]]
399
399
; CHECK-NEXT: ret i32 [[RET]]
400
400
;
401
401
%cmp = icmp sge i32 %x , 0
@@ -422,10 +422,10 @@ define <2 x i32> @ashr_lshr_vec_wrong_pred(<2 x i32> %x, <2 x i32> %y) {
422
422
423
423
define <2 x i32 > @ashr_lshr_inv_vec_wrong_pred (<2 x i32 > %x , <2 x i32 > %y ) {
424
424
; CHECK-LABEL: @ashr_lshr_inv_vec_wrong_pred(
425
- ; CHECK-NEXT: [[CMP:%.*]] = icmp sgt <2 x i32> [[X:%.*]], <i32 -1, i32 -1>
426
- ; CHECK-NEXT: [[L:%.*]] = lshr <2 x i32> [[X]], [[Y:%.*]]
425
+ ; CHECK-NEXT: [[L:%.*]] = lshr <2 x i32> [[X:%.*]], [[Y:%.*]]
427
426
; CHECK-NEXT: [[R:%.*]] = ashr <2 x i32> [[X]], [[Y]]
428
- ; CHECK-NEXT: [[RET:%.*]] = select <2 x i1> [[CMP]], <2 x i32> [[R]], <2 x i32> [[L]]
427
+ ; CHECK-NEXT: [[CMP1:%.*]] = icmp slt <2 x i32> [[X]], zeroinitializer
428
+ ; CHECK-NEXT: [[RET:%.*]] = select <2 x i1> [[CMP1]], <2 x i32> [[L]], <2 x i32> [[R]]
429
429
; CHECK-NEXT: ret <2 x i32> [[RET]]
430
430
;
431
431
%cmp = icmp sge <2 x i32 > %x , zeroinitializer
0 commit comments