1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2; RUN: opt < %s -mtriple=aarch64-unknown-linux-gnu -passes='print<cost-model>' -cost-kind=throughput 2>&1 -disable-output | FileCheck %s --check-prefixes=CHECK,CHECK-NOF16
3; RUN: opt < %s -mtriple=aarch64-unknown-linux-gnu -mattr=+fullfp16 -passes='print<cost-model>' -cost-kind=throughput 2>&1 -disable-output | FileCheck %s --check-prefixes=CHECK,CHECK-F16
4
5define void @reduce_umin() {
6; CHECK-LABEL: 'reduce_umin'
7; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V1i8 = call i8 @llvm.vector.reduce.umin.v1i8(<1 x i8> undef)
8; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V3i8 = call i8 @llvm.vector.reduce.umin.v3i8(<3 x i8> undef)
9; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4i8 = call i8 @llvm.vector.reduce.umin.v4i8(<4 x i8> undef)
10; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V8i8 = call i8 @llvm.vector.reduce.umin.v8i8(<8 x i8> undef)
11; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V16i8 = call i8 @llvm.vector.reduce.umin.v16i8(<16 x i8> undef)
12; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V32i8 = call i8 @llvm.vector.reduce.umin.v32i8(<32 x i8> undef)
13; CHECK-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %V64i8 = call i8 @llvm.vector.reduce.umin.v64i8(<64 x i8> undef)
14; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2i16 = call i16 @llvm.vector.reduce.umin.v2i16(<2 x i16> undef)
15; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4i16 = call i16 @llvm.vector.reduce.umin.v4i16(<4 x i16> undef)
16; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V8i16 = call i16 @llvm.vector.reduce.umin.v8i16(<8 x i16> undef)
17; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V16i16 = call i16 @llvm.vector.reduce.umin.v16i16(<16 x i16> undef)
18; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2i32 = call i32 @llvm.vector.reduce.umin.v2i32(<2 x i32> undef)
19; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4i32 = call i32 @llvm.vector.reduce.umin.v4i32(<4 x i32> undef)
20; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V8i32 = call i32 @llvm.vector.reduce.umin.v8i32(<8 x i32> undef)
21; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2i64 = call i64 @llvm.vector.reduce.umin.v2i64(<2 x i64> undef)
22; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V4i64 = call i64 @llvm.vector.reduce.umin.v4i64(<4 x i64> undef)
23; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
24;
25  %V1i8 = call i8 @llvm.vector.reduce.umin.v1i8(<1 x i8> undef)
26  %V3i8 = call i8 @llvm.vector.reduce.umin.v3i8(<3 x i8> undef)
27  %V4i8 = call i8 @llvm.vector.reduce.umin.v4i8(<4 x i8> undef)
28  %V8i8 = call i8 @llvm.vector.reduce.umin.v8i8(<8 x i8> undef)
29  %V16i8 = call i8 @llvm.vector.reduce.umin.v16i8(<16 x i8> undef)
30  %V32i8 = call i8 @llvm.vector.reduce.umin.v32i8(<32 x i8> undef)
31  %V64i8 = call i8 @llvm.vector.reduce.umin.v64i8(<64 x i8> undef)
32  %V2i16 = call i16 @llvm.vector.reduce.umin.v2i16(<2 x i16> undef)
33  %V4i16 = call i16 @llvm.vector.reduce.umin.v4i16(<4 x i16> undef)
34  %V8i16 = call i16 @llvm.vector.reduce.umin.v8i16(<8 x i16> undef)
35  %V16i16 = call i16 @llvm.vector.reduce.umin.v16i16(<16 x i16> undef)
36  %V2i32 = call i32 @llvm.vector.reduce.umin.v2i32(<2 x i32> undef)
37  %V4i32 = call i32 @llvm.vector.reduce.umin.v4i32(<4 x i32> undef)
38  %V8i32 = call i32 @llvm.vector.reduce.umin.v8i32(<8 x i32> undef)
39  %V2i64 = call i64 @llvm.vector.reduce.umin.v2i64(<2 x i64> undef)
40  %V4i64 = call i64 @llvm.vector.reduce.umin.v4i64(<4 x i64> undef)
41  ret void
42}
43
44define void @reduce_umax() {
45; CHECK-LABEL: 'reduce_umax'
46; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V1i8 = call i8 @llvm.vector.reduce.umax.v1i8(<1 x i8> undef)
47; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V3i8 = call i8 @llvm.vector.reduce.umax.v3i8(<3 x i8> undef)
48; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4i8 = call i8 @llvm.vector.reduce.umax.v4i8(<4 x i8> undef)
49; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V8i8 = call i8 @llvm.vector.reduce.umax.v8i8(<8 x i8> undef)
50; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V16i8 = call i8 @llvm.vector.reduce.umax.v16i8(<16 x i8> undef)
51; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V32i8 = call i8 @llvm.vector.reduce.umax.v32i8(<32 x i8> undef)
52; CHECK-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %V64i8 = call i8 @llvm.vector.reduce.umax.v64i8(<64 x i8> undef)
53; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2i16 = call i16 @llvm.vector.reduce.umax.v2i16(<2 x i16> undef)
54; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4i16 = call i16 @llvm.vector.reduce.umax.v4i16(<4 x i16> undef)
55; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V8i16 = call i16 @llvm.vector.reduce.umax.v8i16(<8 x i16> undef)
56; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V16i16 = call i16 @llvm.vector.reduce.umax.v16i16(<16 x i16> undef)
57; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2i32 = call i32 @llvm.vector.reduce.umax.v2i32(<2 x i32> undef)
58; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4i32 = call i32 @llvm.vector.reduce.umax.v4i32(<4 x i32> undef)
59; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V8i32 = call i32 @llvm.vector.reduce.umax.v8i32(<8 x i32> undef)
60; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2i64 = call i64 @llvm.vector.reduce.umax.v2i64(<2 x i64> undef)
61; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V4i64 = call i64 @llvm.vector.reduce.umax.v4i64(<4 x i64> undef)
62; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
63;
64  %V1i8 = call i8 @llvm.vector.reduce.umax.v1i8(<1 x i8> undef)
65  %V3i8 = call i8 @llvm.vector.reduce.umax.v3i8(<3 x i8> undef)
66  %V4i8 = call i8 @llvm.vector.reduce.umax.v4i8(<4 x i8> undef)
67  %V8i8 = call i8 @llvm.vector.reduce.umax.v8i8(<8 x i8> undef)
68  %V16i8 = call i8 @llvm.vector.reduce.umax.v16i8(<16 x i8> undef)
69  %V32i8 = call i8 @llvm.vector.reduce.umax.v32i8(<32 x i8> undef)
70  %V64i8 = call i8 @llvm.vector.reduce.umax.v64i8(<64 x i8> undef)
71  %V2i16 = call i16 @llvm.vector.reduce.umax.v2i16(<2 x i16> undef)
72  %V4i16 = call i16 @llvm.vector.reduce.umax.v4i16(<4 x i16> undef)
73  %V8i16 = call i16 @llvm.vector.reduce.umax.v8i16(<8 x i16> undef)
74  %V16i16 = call i16 @llvm.vector.reduce.umax.v16i16(<16 x i16> undef)
75  %V2i32 = call i32 @llvm.vector.reduce.umax.v2i32(<2 x i32> undef)
76  %V4i32 = call i32 @llvm.vector.reduce.umax.v4i32(<4 x i32> undef)
77  %V8i32 = call i32 @llvm.vector.reduce.umax.v8i32(<8 x i32> undef)
78  %V2i64 = call i64 @llvm.vector.reduce.umax.v2i64(<2 x i64> undef)
79  %V4i64 = call i64 @llvm.vector.reduce.umax.v4i64(<4 x i64> undef)
80  ret void
81}
82
83define void @reduce_smin() {
84; CHECK-LABEL: 'reduce_smin'
85; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V1i8 = call i8 @llvm.vector.reduce.smin.v1i8(<1 x i8> undef)
86; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V3i8 = call i8 @llvm.vector.reduce.smin.v3i8(<3 x i8> undef)
87; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4i8 = call i8 @llvm.vector.reduce.smin.v4i8(<4 x i8> undef)
88; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V8i8 = call i8 @llvm.vector.reduce.smin.v8i8(<8 x i8> undef)
89; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V16i8 = call i8 @llvm.vector.reduce.smin.v16i8(<16 x i8> undef)
90; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V32i8 = call i8 @llvm.vector.reduce.smin.v32i8(<32 x i8> undef)
91; CHECK-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %V64i8 = call i8 @llvm.vector.reduce.smin.v64i8(<64 x i8> undef)
92; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2i16 = call i16 @llvm.vector.reduce.smin.v2i16(<2 x i16> undef)
93; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4i16 = call i16 @llvm.vector.reduce.smin.v4i16(<4 x i16> undef)
94; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V8i16 = call i16 @llvm.vector.reduce.smin.v8i16(<8 x i16> undef)
95; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V16i16 = call i16 @llvm.vector.reduce.smin.v16i16(<16 x i16> undef)
96; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2i32 = call i32 @llvm.vector.reduce.smin.v2i32(<2 x i32> undef)
97; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4i32 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> undef)
98; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V8i32 = call i32 @llvm.vector.reduce.smin.v8i32(<8 x i32> undef)
99; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2i64 = call i64 @llvm.vector.reduce.smin.v2i64(<2 x i64> undef)
100; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V4i64 = call i64 @llvm.vector.reduce.smin.v4i64(<4 x i64> undef)
101; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
102;
103  %V1i8 = call i8 @llvm.vector.reduce.smin.v1i8(<1 x i8> undef)
104  %V3i8 = call i8 @llvm.vector.reduce.smin.v3i8(<3 x i8> undef)
105  %V4i8 = call i8 @llvm.vector.reduce.smin.v4i8(<4 x i8> undef)
106  %V8i8 = call i8 @llvm.vector.reduce.smin.v8i8(<8 x i8> undef)
107  %V16i8 = call i8 @llvm.vector.reduce.smin.v16i8(<16 x i8> undef)
108  %V32i8 = call i8 @llvm.vector.reduce.smin.v32i8(<32 x i8> undef)
109  %V64i8 = call i8 @llvm.vector.reduce.smin.v64i8(<64 x i8> undef)
110  %V2i16 = call i16 @llvm.vector.reduce.smin.v2i16(<2 x i16> undef)
111  %V4i16 = call i16 @llvm.vector.reduce.smin.v4i16(<4 x i16> undef)
112  %V8i16 = call i16 @llvm.vector.reduce.smin.v8i16(<8 x i16> undef)
113  %V16i16 = call i16 @llvm.vector.reduce.smin.v16i16(<16 x i16> undef)
114  %V2i32 = call i32 @llvm.vector.reduce.smin.v2i32(<2 x i32> undef)
115  %V4i32 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> undef)
116  %V8i32 = call i32 @llvm.vector.reduce.smin.v8i32(<8 x i32> undef)
117  %V2i64 = call i64 @llvm.vector.reduce.smin.v2i64(<2 x i64> undef)
118  %V4i64 = call i64 @llvm.vector.reduce.smin.v4i64(<4 x i64> undef)
119  ret void
120}
121
122define void @reduce_smax() {
123; CHECK-LABEL: 'reduce_smax'
124; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V1i8 = call i8 @llvm.vector.reduce.smax.v1i8(<1 x i8> undef)
125; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V3i8 = call i8 @llvm.vector.reduce.smax.v3i8(<3 x i8> undef)
126; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4i8 = call i8 @llvm.vector.reduce.smax.v4i8(<4 x i8> undef)
127; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V8i8 = call i8 @llvm.vector.reduce.smax.v8i8(<8 x i8> undef)
128; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V16i8 = call i8 @llvm.vector.reduce.smax.v16i8(<16 x i8> undef)
129; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V32i8 = call i8 @llvm.vector.reduce.smax.v32i8(<32 x i8> undef)
130; CHECK-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %V64i8 = call i8 @llvm.vector.reduce.smax.v64i8(<64 x i8> undef)
131; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2i16 = call i16 @llvm.vector.reduce.smax.v2i16(<2 x i16> undef)
132; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4i16 = call i16 @llvm.vector.reduce.smax.v4i16(<4 x i16> undef)
133; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V8i16 = call i16 @llvm.vector.reduce.smax.v8i16(<8 x i16> undef)
134; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V16i16 = call i16 @llvm.vector.reduce.smax.v16i16(<16 x i16> undef)
135; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2i32 = call i32 @llvm.vector.reduce.smax.v2i32(<2 x i32> undef)
136; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4i32 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> undef)
137; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V8i32 = call i32 @llvm.vector.reduce.smax.v8i32(<8 x i32> undef)
138; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2i64 = call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> undef)
139; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V4i64 = call i64 @llvm.vector.reduce.smax.v4i64(<4 x i64> undef)
140; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
141;
142  %V1i8 = call i8 @llvm.vector.reduce.smax.v1i8(<1 x i8> undef)
143  %V3i8 = call i8 @llvm.vector.reduce.smax.v3i8(<3 x i8> undef)
144  %V4i8 = call i8 @llvm.vector.reduce.smax.v4i8(<4 x i8> undef)
145  %V8i8 = call i8 @llvm.vector.reduce.smax.v8i8(<8 x i8> undef)
146  %V16i8 = call i8 @llvm.vector.reduce.smax.v16i8(<16 x i8> undef)
147  %V32i8 = call i8 @llvm.vector.reduce.smax.v32i8(<32 x i8> undef)
148  %V64i8 = call i8 @llvm.vector.reduce.smax.v64i8(<64 x i8> undef)
149  %V2i16 = call i16 @llvm.vector.reduce.smax.v2i16(<2 x i16> undef)
150  %V4i16 = call i16 @llvm.vector.reduce.smax.v4i16(<4 x i16> undef)
151  %V8i16 = call i16 @llvm.vector.reduce.smax.v8i16(<8 x i16> undef)
152  %V16i16 = call i16 @llvm.vector.reduce.smax.v16i16(<16 x i16> undef)
153  %V2i32 = call i32 @llvm.vector.reduce.smax.v2i32(<2 x i32> undef)
154  %V4i32 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> undef)
155  %V8i32 = call i32 @llvm.vector.reduce.smax.v8i32(<8 x i32> undef)
156  %V2i64 = call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> undef)
157  %V4i64 = call i64 @llvm.vector.reduce.smax.v4i64(<4 x i64> undef)
158  ret void
159}
160
161define void @reduce_fmin16() {
162; CHECK-NOF16-LABEL: 'reduce_fmin16'
163; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %V2f16 = call half @llvm.vector.reduce.fmin.v2f16(<2 x half> undef)
164; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 58 for instruction: %V4f16 = call half @llvm.vector.reduce.fmin.v4f16(<4 x half> undef)
165; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 198 for instruction: %V8f16 = call half @llvm.vector.reduce.fmin.v8f16(<8 x half> undef)
166; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 298 for instruction: %V16f16 = call half @llvm.vector.reduce.fmin.v16f16(<16 x half> undef)
167; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
168;
169; CHECK-F16-LABEL: 'reduce_fmin16'
170; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2f16 = call half @llvm.vector.reduce.fmin.v2f16(<2 x half> undef)
171; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4f16 = call half @llvm.vector.reduce.fmin.v4f16(<4 x half> undef)
172; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V8f16 = call half @llvm.vector.reduce.fmin.v8f16(<8 x half> undef)
173; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V16f16 = call half @llvm.vector.reduce.fmin.v16f16(<16 x half> undef)
174; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
175;
176  %V2f16 = call half @llvm.vector.reduce.fmin.v2f16(<2 x half> undef)
177  %V4f16 = call half @llvm.vector.reduce.fmin.v4f16(<4 x half> undef)
178  %V8f16 = call half @llvm.vector.reduce.fmin.v8f16(<8 x half> undef)
179  %V16f16 = call half @llvm.vector.reduce.fmin.v16f16(<16 x half> undef)
180  ret void
181}
182
183define void @reduce_fmax16() {
184; CHECK-NOF16-LABEL: 'reduce_fmax16'
185; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %V2f16 = call half @llvm.vector.reduce.fmax.v2f16(<2 x half> undef)
186; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 58 for instruction: %V4f16 = call half @llvm.vector.reduce.fmax.v4f16(<4 x half> undef)
187; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 198 for instruction: %V8f16 = call half @llvm.vector.reduce.fmax.v8f16(<8 x half> undef)
188; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 298 for instruction: %V16f16 = call half @llvm.vector.reduce.fmax.v16f16(<16 x half> undef)
189; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
190;
191; CHECK-F16-LABEL: 'reduce_fmax16'
192; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2f16 = call half @llvm.vector.reduce.fmax.v2f16(<2 x half> undef)
193; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4f16 = call half @llvm.vector.reduce.fmax.v4f16(<4 x half> undef)
194; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V8f16 = call half @llvm.vector.reduce.fmax.v8f16(<8 x half> undef)
195; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V16f16 = call half @llvm.vector.reduce.fmax.v16f16(<16 x half> undef)
196; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
197;
198  %V2f16 = call half @llvm.vector.reduce.fmax.v2f16(<2 x half> undef)
199  %V4f16 = call half @llvm.vector.reduce.fmax.v4f16(<4 x half> undef)
200  %V8f16 = call half @llvm.vector.reduce.fmax.v8f16(<8 x half> undef)
201  %V16f16 = call half @llvm.vector.reduce.fmax.v16f16(<16 x half> undef)
202  ret void
203}
204
205define void @reduce_fmin() {
206; CHECK-LABEL: 'reduce_fmin'
207; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2f32 = call float @llvm.vector.reduce.fmin.v2f32(<2 x float> undef)
208; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4f32 = call float @llvm.vector.reduce.fmin.v4f32(<4 x float> undef)
209; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V8f32 = call float @llvm.vector.reduce.fmin.v8f32(<8 x float> undef)
210; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2f64 = call double @llvm.vector.reduce.fmin.v2f64(<2 x double> undef)
211; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V4f64 = call double @llvm.vector.reduce.fmin.v4f64(<4 x double> undef)
212; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
213;
214  %V2f32 = call float @llvm.vector.reduce.fmin.v2f32(<2 x float> undef)
215  %V4f32 = call float @llvm.vector.reduce.fmin.v4f32(<4 x float> undef)
216  %V8f32 = call float @llvm.vector.reduce.fmin.v8f32(<8 x float> undef)
217  %V2f64 = call double @llvm.vector.reduce.fmin.v2f64(<2 x double> undef)
218  %V4f64 = call double @llvm.vector.reduce.fmin.v4f64(<4 x double> undef)
219  ret void
220}
221
222define void @reduce_fmax() {
223; CHECK-LABEL: 'reduce_fmax'
224; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2f32 = call float @llvm.vector.reduce.fmax.v2f32(<2 x float> undef)
225; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4f32 = call float @llvm.vector.reduce.fmax.v4f32(<4 x float> undef)
226; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V8f32 = call float @llvm.vector.reduce.fmax.v8f32(<8 x float> undef)
227; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2f64 = call double @llvm.vector.reduce.fmax.v2f64(<2 x double> undef)
228; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V4f64 = call double @llvm.vector.reduce.fmax.v4f64(<4 x double> undef)
229; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
230;
231  %V2f32 = call float @llvm.vector.reduce.fmax.v2f32(<2 x float> undef)
232  %V4f32 = call float @llvm.vector.reduce.fmax.v4f32(<4 x float> undef)
233  %V8f32 = call float @llvm.vector.reduce.fmax.v8f32(<8 x float> undef)
234  %V2f64 = call double @llvm.vector.reduce.fmax.v2f64(<2 x double> undef)
235  %V4f64 = call double @llvm.vector.reduce.fmax.v4f64(<4 x double> undef)
236  ret void
237}
238
239declare i8 @llvm.vector.reduce.umin.v1i8(<1 x i8>)
240declare i8 @llvm.vector.reduce.umin.v3i8(<3 x i8>)
241declare i8 @llvm.vector.reduce.umin.v4i8(<4 x i8>)
242declare i8 @llvm.vector.reduce.umin.v8i8(<8 x i8>)
243declare i8 @llvm.vector.reduce.umin.v16i8(<16 x i8>)
244declare i8 @llvm.vector.reduce.umin.v32i8(<32 x i8>)
245declare i8 @llvm.vector.reduce.umin.v64i8(<64 x i8>)
246declare i16 @llvm.vector.reduce.umin.v2i16(<2 x i16>)
247declare i16 @llvm.vector.reduce.umin.v4i16(<4 x i16>)
248declare i16 @llvm.vector.reduce.umin.v8i16(<8 x i16>)
249declare i16 @llvm.vector.reduce.umin.v16i16(<16 x i16>)
250declare i32 @llvm.vector.reduce.umin.v2i32(<2 x i32>)
251declare i32 @llvm.vector.reduce.umin.v4i32(<4 x i32>)
252declare i32 @llvm.vector.reduce.umin.v8i32(<8 x i32>)
253declare i64 @llvm.vector.reduce.umin.v2i64(<2 x i64>)
254declare i64 @llvm.vector.reduce.umin.v4i64(<4 x i64>)
255
256declare i8 @llvm.vector.reduce.umax.v1i8(<1 x i8>)
257declare i8 @llvm.vector.reduce.umax.v3i8(<3 x i8>)
258declare i8 @llvm.vector.reduce.umax.v4i8(<4 x i8>)
259declare i8 @llvm.vector.reduce.umax.v8i8(<8 x i8>)
260declare i8 @llvm.vector.reduce.umax.v16i8(<16 x i8>)
261declare i8 @llvm.vector.reduce.umax.v32i8(<32 x i8>)
262declare i8 @llvm.vector.reduce.umax.v64i8(<64 x i8>)
263declare i16 @llvm.vector.reduce.umax.v2i16(<2 x i16>)
264declare i16 @llvm.vector.reduce.umax.v4i16(<4 x i16>)
265declare i16 @llvm.vector.reduce.umax.v8i16(<8 x i16>)
266declare i16 @llvm.vector.reduce.umax.v16i16(<16 x i16>)
267declare i32 @llvm.vector.reduce.umax.v2i32(<2 x i32>)
268declare i32 @llvm.vector.reduce.umax.v4i32(<4 x i32>)
269declare i32 @llvm.vector.reduce.umax.v8i32(<8 x i32>)
270declare i64 @llvm.vector.reduce.umax.v2i64(<2 x i64>)
271declare i64 @llvm.vector.reduce.umax.v4i64(<4 x i64>)
272
273declare i8 @llvm.vector.reduce.smin.v1i8(<1 x i8>)
274declare i8 @llvm.vector.reduce.smin.v3i8(<3 x i8>)
275declare i8 @llvm.vector.reduce.smin.v4i8(<4 x i8>)
276declare i8 @llvm.vector.reduce.smin.v8i8(<8 x i8>)
277declare i8 @llvm.vector.reduce.smin.v16i8(<16 x i8>)
278declare i8 @llvm.vector.reduce.smin.v32i8(<32 x i8>)
279declare i8 @llvm.vector.reduce.smin.v64i8(<64 x i8>)
280declare i16 @llvm.vector.reduce.smin.v2i16(<2 x i16>)
281declare i16 @llvm.vector.reduce.smin.v4i16(<4 x i16>)
282declare i16 @llvm.vector.reduce.smin.v8i16(<8 x i16>)
283declare i16 @llvm.vector.reduce.smin.v16i16(<16 x i16>)
284declare i32 @llvm.vector.reduce.smin.v2i32(<2 x i32>)
285declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>)
286declare i32 @llvm.vector.reduce.smin.v8i32(<8 x i32>)
287declare i64 @llvm.vector.reduce.smin.v2i64(<2 x i64>)
288declare i64 @llvm.vector.reduce.smin.v4i64(<4 x i64>)
289
290declare i8 @llvm.vector.reduce.smax.v1i8(<1 x i8>)
291declare i8 @llvm.vector.reduce.smax.v3i8(<3 x i8>)
292declare i8 @llvm.vector.reduce.smax.v4i8(<4 x i8>)
293declare i8 @llvm.vector.reduce.smax.v8i8(<8 x i8>)
294declare i8 @llvm.vector.reduce.smax.v16i8(<16 x i8>)
295declare i8 @llvm.vector.reduce.smax.v32i8(<32 x i8>)
296declare i8 @llvm.vector.reduce.smax.v64i8(<64 x i8>)
297declare i16 @llvm.vector.reduce.smax.v2i16(<2 x i16>)
298declare i16 @llvm.vector.reduce.smax.v4i16(<4 x i16>)
299declare i16 @llvm.vector.reduce.smax.v8i16(<8 x i16>)
300declare i16 @llvm.vector.reduce.smax.v16i16(<16 x i16>)
301declare i32 @llvm.vector.reduce.smax.v2i32(<2 x i32>)
302declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>)
303declare i32 @llvm.vector.reduce.smax.v8i32(<8 x i32>)
304declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>)
305declare i64 @llvm.vector.reduce.smax.v4i64(<4 x i64>)
306
307declare half @llvm.vector.reduce.fmin.v2f16(<2 x half>)
308declare half @llvm.vector.reduce.fmin.v4f16(<4 x half>)
309declare half @llvm.vector.reduce.fmin.v8f16(<8 x half>)
310declare half @llvm.vector.reduce.fmin.v16f16(<16 x half>)
311declare float @llvm.vector.reduce.fmin.v2f32(<2 x float>)
312declare float @llvm.vector.reduce.fmin.v4f32(<4 x float>)
313declare float @llvm.vector.reduce.fmin.v8f32(<8 x float>)
314declare double @llvm.vector.reduce.fmin.v2f64(<2 x double>)
315declare double @llvm.vector.reduce.fmin.v4f64(<4 x double>)
316
317declare half @llvm.vector.reduce.fmax.v2f16(<2 x half>)
318declare half @llvm.vector.reduce.fmax.v4f16(<4 x half>)
319declare half @llvm.vector.reduce.fmax.v8f16(<8 x half>)
320declare half @llvm.vector.reduce.fmax.v16f16(<16 x half>)
321declare float @llvm.vector.reduce.fmax.v2f32(<2 x float>)
322declare float @llvm.vector.reduce.fmax.v4f32(<4 x float>)
323declare float @llvm.vector.reduce.fmax.v8f32(<8 x float>)
324declare double @llvm.vector.reduce.fmax.v2f64(<2 x double>)
325declare double @llvm.vector.reduce.fmax.v4f64(<4 x double>)
326