@@ -13,8 +13,7 @@ define i32 @reduce_add(<4 x i32> %x) {
13
13
14
14
define i32 @reduce_or (<4 x i32 > %x ) {
15
15
; CHECK-LABEL: @reduce_or(
16
- ; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <4 x i32> [[X:%.*]], <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
17
- ; CHECK-NEXT: [[RES:%.*]] = call i32 @llvm.vector.reduce.or.v4i32(<4 x i32> [[SHUF]])
16
+ ; CHECK-NEXT: [[RES:%.*]] = call i32 @llvm.vector.reduce.or.v4i32(<4 x i32> [[X:%.*]])
18
17
; CHECK-NEXT: ret i32 [[RES]]
19
18
;
20
19
%shuf = shufflevector <4 x i32 > poison, <4 x i32 > %x , <4 x i32 > <i32 7 , i32 6 , i32 5 , i32 4 >
@@ -24,8 +23,7 @@ define i32 @reduce_or(<4 x i32> %x) {
24
23
25
24
define i32 @reduce_and (<4 x i32 > %x ) {
26
25
; CHECK-LABEL: @reduce_and(
27
- ; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <4 x i32> [[X:%.*]], <4 x i32> poison, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
28
- ; CHECK-NEXT: [[RES:%.*]] = call i32 @llvm.vector.reduce.and.v4i32(<4 x i32> [[SHUF]])
26
+ ; CHECK-NEXT: [[RES:%.*]] = call i32 @llvm.vector.reduce.and.v4i32(<4 x i32> [[X:%.*]])
29
27
; CHECK-NEXT: ret i32 [[RES]]
30
28
;
31
29
%shuf = shufflevector <4 x i32 > %x , <4 x i32 > poison, <4 x i32 > <i32 0 , i32 2 , i32 1 , i32 3 >
@@ -35,8 +33,7 @@ define i32 @reduce_and(<4 x i32> %x) {
35
33
36
34
define i32 @reduce_xor (<4 x i32 > %x ) {
37
35
; CHECK-LABEL: @reduce_xor(
38
- ; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <4 x i32> [[X:%.*]], <4 x i32> poison, <4 x i32> <i32 1, i32 2, i32 3, i32 0>
39
- ; CHECK-NEXT: [[RES:%.*]] = call i32 @llvm.vector.reduce.xor.v4i32(<4 x i32> [[SHUF]])
36
+ ; CHECK-NEXT: [[RES:%.*]] = call i32 @llvm.vector.reduce.xor.v4i32(<4 x i32> [[X:%.*]])
40
37
; CHECK-NEXT: ret i32 [[RES]]
41
38
;
42
39
%shuf = shufflevector <4 x i32 > poison, <4 x i32 > %x , <4 x i32 > <i32 5 , i32 6 , i32 7 , i32 4 >
@@ -46,8 +43,7 @@ define i32 @reduce_xor(<4 x i32> %x) {
46
43
47
44
define i32 @reduce_umax (<4 x i32 > %x ) {
48
45
; CHECK-LABEL: @reduce_umax(
49
- ; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <4 x i32> [[X:%.*]], <4 x i32> poison, <4 x i32> <i32 2, i32 1, i32 3, i32 0>
50
- ; CHECK-NEXT: [[RES:%.*]] = call i32 @llvm.vector.reduce.umax.v4i32(<4 x i32> [[SHUF]])
46
+ ; CHECK-NEXT: [[RES:%.*]] = call i32 @llvm.vector.reduce.umax.v4i32(<4 x i32> [[X:%.*]])
51
47
; CHECK-NEXT: ret i32 [[RES]]
52
48
;
53
49
%shuf = shufflevector <4 x i32 > %x , <4 x i32 > poison, <4 x i32 > <i32 2 , i32 1 , i32 3 , i32 0 >
@@ -57,8 +53,7 @@ define i32 @reduce_umax(<4 x i32> %x) {
57
53
58
54
define i32 @reduce_umin (<4 x i32 > %x ) {
59
55
; CHECK-LABEL: @reduce_umin(
60
- ; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <4 x i32> [[X:%.*]], <4 x i32> poison, <4 x i32> <i32 2, i32 3, i32 0, i32 1>
61
- ; CHECK-NEXT: [[RES:%.*]] = call i32 @llvm.vector.reduce.umin.v4i32(<4 x i32> [[SHUF]])
56
+ ; CHECK-NEXT: [[RES:%.*]] = call i32 @llvm.vector.reduce.umin.v4i32(<4 x i32> [[X:%.*]])
62
57
; CHECK-NEXT: ret i32 [[RES]]
63
58
;
64
59
%shuf = shufflevector <4 x i32 > %x , <4 x i32 > poison, <4 x i32 > <i32 2 , i32 3 , i32 0 , i32 1 >
@@ -68,8 +63,7 @@ define i32 @reduce_umin(<4 x i32> %x) {
68
63
69
64
define i32 @reduce_smax (<4 x i32 > %x ) {
70
65
; CHECK-LABEL: @reduce_smax(
71
- ; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <4 x i32> [[X:%.*]], <4 x i32> poison, <4 x i32> <i32 2, i32 0, i32 3, i32 1>
72
- ; CHECK-NEXT: [[RES:%.*]] = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> [[SHUF]])
66
+ ; CHECK-NEXT: [[RES:%.*]] = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> [[X:%.*]])
73
67
; CHECK-NEXT: ret i32 [[RES]]
74
68
;
75
69
%shuf = shufflevector <4 x i32 > %x , <4 x i32 > poison, <4 x i32 > <i32 2 , i32 0 , i32 3 , i32 1 >
@@ -79,8 +73,7 @@ define i32 @reduce_smax(<4 x i32> %x) {
79
73
80
74
define i32 @reduce_smin (<4 x i32 > %x ) {
81
75
; CHECK-LABEL: @reduce_smin(
82
- ; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <4 x i32> [[X:%.*]], <4 x i32> poison, <4 x i32> <i32 0, i32 3, i32 1, i32 2>
83
- ; CHECK-NEXT: [[RES:%.*]] = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> [[SHUF]])
76
+ ; CHECK-NEXT: [[RES:%.*]] = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> [[X:%.*]])
84
77
; CHECK-NEXT: ret i32 [[RES]]
85
78
;
86
79
%shuf = shufflevector <4 x i32 > %x , <4 x i32 > poison, <4 x i32 > <i32 0 , i32 3 , i32 1 , i32 2 >
@@ -90,19 +83,17 @@ define i32 @reduce_smin(<4 x i32> %x) {
90
83
91
84
define float @reduce_fmax (<4 x float > %x ) {
92
85
; CHECK-LABEL: @reduce_fmax(
93
- ; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <4 x float> [[X:%.*]], <4 x float> poison, <4 x i32> <i32 2, i32 0, i32 3, i32 1>
94
- ; CHECK-NEXT: [[RES:%.*]] = call float @llvm.vector.reduce.fmax.v4f32(<4 x float> [[SHUF]])
86
+ ; CHECK-NEXT: [[RES:%.*]] = call nnan nsz float @llvm.vector.reduce.fmax.v4f32(<4 x float> [[X:%.*]])
95
87
; CHECK-NEXT: ret float [[RES]]
96
88
;
97
89
%shuf = shufflevector <4 x float > %x , <4 x float > poison, <4 x i32 > <i32 2 , i32 0 , i32 3 , i32 1 >
98
- %res = call float @llvm.vector.reduce.fmax.v4f32 (<4 x float > %shuf )
90
+ %res = call nsz nnan float @llvm.vector.reduce.fmax.v4f32 (<4 x float > %shuf )
99
91
ret float %res
100
92
}
101
93
102
94
define float @reduce_fmin (<4 x float > %x ) {
103
95
; CHECK-LABEL: @reduce_fmin(
104
- ; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <4 x float> [[X:%.*]], <4 x float> poison, <4 x i32> <i32 0, i32 3, i32 1, i32 2>
105
- ; CHECK-NEXT: [[RES:%.*]] = call float @llvm.vector.reduce.fmin.v4f32(<4 x float> [[SHUF]])
96
+ ; CHECK-NEXT: [[RES:%.*]] = call float @llvm.vector.reduce.fmin.v4f32(<4 x float> [[X:%.*]])
106
97
; CHECK-NEXT: ret float [[RES]]
107
98
;
108
99
%shuf = shufflevector <4 x float > %x , <4 x float > poison, <4 x i32 > <i32 0 , i32 3 , i32 1 , i32 2 >
@@ -112,8 +103,7 @@ define float @reduce_fmin(<4 x float> %x) {
112
103
113
104
define float @reduce_fadd (float %a , <4 x float > %x ) {
114
105
; CHECK-LABEL: @reduce_fadd(
115
- ; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <4 x float> [[X:%.*]], <4 x float> undef, <4 x i32> <i32 0, i32 3, i32 1, i32 2>
116
- ; CHECK-NEXT: [[RES:%.*]] = call reassoc float @llvm.vector.reduce.fadd.v4f32(float [[A:%.*]], <4 x float> [[SHUF]])
106
+ ; CHECK-NEXT: [[RES:%.*]] = call reassoc float @llvm.vector.reduce.fadd.v4f32(float [[A:%.*]], <4 x float> [[X:%.*]])
117
107
; CHECK-NEXT: ret float [[RES]]
118
108
;
119
109
%shuf = shufflevector <4 x float > %x , <4 x float > %x , <4 x i32 > <i32 0 , i32 3 , i32 1 , i32 2 >
@@ -123,8 +113,7 @@ define float @reduce_fadd(float %a, <4 x float> %x) {
123
113
124
114
define float @reduce_fmul (float %a , <4 x float > %x ) {
125
115
; CHECK-LABEL: @reduce_fmul(
126
- ; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <4 x float> [[X:%.*]], <4 x float> poison, <4 x i32> <i32 0, i32 3, i32 1, i32 2>
127
- ; CHECK-NEXT: [[RES:%.*]] = call reassoc float @llvm.vector.reduce.fmul.v4f32(float [[A:%.*]], <4 x float> [[SHUF]])
116
+ ; CHECK-NEXT: [[RES:%.*]] = call reassoc float @llvm.vector.reduce.fmul.v4f32(float [[A:%.*]], <4 x float> [[X:%.*]])
128
117
; CHECK-NEXT: ret float [[RES]]
129
118
;
130
119
%shuf = shufflevector <4 x float > %x , <4 x float > zeroinitializer , <4 x i32 > <i32 0 , i32 3 , i32 1 , i32 2 >
0 commit comments