xref: /llvm-project/llvm/test/Analysis/CostModel/ARM/intrinsic-cost-kinds.ll (revision 9c9f94063ce1bd819ba4482f537d1e580dd31eef)
1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2; RUN: opt -mtriple=armv8.1m.main -mattr=+mve.fp -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=throughput   < %s | FileCheck %s --check-prefix=THRU
3; RUN: opt -mtriple=armv8.1m.main -mattr=+mve.fp -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=latency      < %s | FileCheck %s --check-prefix=LATE
4; RUN: opt -mtriple=armv8.1m.main -mattr=+mve.fp -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size    < %s | FileCheck %s --check-prefix=SIZE
5; RUN: opt -mtriple=armv8.1m.main -mattr=+mve.fp -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=size-latency < %s | FileCheck %s --check-prefix=SIZE_LATE
6
7target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
8
9; Test a cross-section of intrinsics for various cost-kinds.
10; Other test files may check for accuracy of a particular intrinsic
11; across subtargets or types. This is just a basic correctness check using an
12; ARM target and a legal scalar type (i32/float) and/or an
13; illegal vector type (16 x i32/float).
14
15declare i32 @llvm.smax.i32(i32, i32)
16declare <16 x i32> @llvm.smax.v16i32(<16 x i32>, <16 x i32>)
17
18declare float @llvm.fmuladd.f32(float, float, float)
19declare <16 x float> @llvm.fmuladd.v16f32(<16 x float>, <16 x float>, <16 x float>)
20
21declare float @llvm.log2.f32(float)
22declare <16 x float> @llvm.log2.v16f32(<16 x float>)
23
24declare float @llvm.experimental.constrained.fadd.f32(float, float, metadata, metadata)
25declare <16 x float> @llvm.experimental.constrained.fadd.v16f32(<16 x float>, <16 x float>, metadata, metadata)
26
27declare float @llvm.maximum.f32(float, float)
28declare <16 x float> @llvm.maximum.v16f32(<16 x float>, <16 x float>)
29
30declare i32 @llvm.cttz.i32(i32, i1)
31declare <16 x i32> @llvm.cttz.v16i32(<16 x i32>, i1)
32
33declare i32 @llvm.ctlz.i32(i32, i1)
34declare <16 x i32> @llvm.ctlz.v16i32(<16 x i32>, i1)
35
36declare i32 @llvm.fshl.i32(i32, i32, i32)
37declare <16 x i32> @llvm.fshl.v16i32(<16 x i32>, <16 x i32>, <16 x i32>)
38
39declare <16 x float> @llvm.masked.gather.v16f32.v16p0(<16 x ptr>, i32, <16 x i1>, <16 x float>)
40declare void @llvm.masked.scatter.v16f32.v16p0(<16 x float>, <16 x ptr>, i32, <16 x i1>)
41declare float @llvm.vector.reduce.fmax.v16f32(<16 x float>)
42
43declare void @llvm.memcpy.p0.p0.i32(ptr, ptr, i32, i1)
44
45declare i32 @llvm.ssa.copy.i32(i32)
46declare float @llvm.ssa.copy.f32(float)
47declare ptr @llvm.ssa.copy.p0(ptr)
48
49define void @smax(i32 %a, i32 %b, <16 x i32> %va, <16 x i32> %vb) {
50; THRU-LABEL: 'smax'
51; THRU-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %s = call i32 @llvm.smax.i32(i32 %a, i32 %b)
52; THRU-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v = call <16 x i32> @llvm.smax.v16i32(<16 x i32> %va, <16 x i32> %vb)
53; THRU-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
54;
55; LATE-LABEL: 'smax'
56; LATE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %s = call i32 @llvm.smax.i32(i32 %a, i32 %b)
57; LATE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v = call <16 x i32> @llvm.smax.v16i32(<16 x i32> %va, <16 x i32> %vb)
58; LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
59;
60; SIZE-LABEL: 'smax'
61; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %s = call i32 @llvm.smax.i32(i32 %a, i32 %b)
62; SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v = call <16 x i32> @llvm.smax.v16i32(<16 x i32> %va, <16 x i32> %vb)
63; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
64;
65; SIZE_LATE-LABEL: 'smax'
66; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %s = call i32 @llvm.smax.i32(i32 %a, i32 %b)
67; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v = call <16 x i32> @llvm.smax.v16i32(<16 x i32> %va, <16 x i32> %vb)
68; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
69;
70  %s = call i32 @llvm.smax.i32(i32 %a, i32 %b)
71  %v = call <16 x i32> @llvm.smax.v16i32(<16 x i32> %va, <16 x i32> %vb)
72  ret void
73}
74
75define void @fmuladd(float %a, float %b, float %c, <16 x float> %va, <16 x float> %vb, <16 x float> %vc) {
76; THRU-LABEL: 'fmuladd'
77; THRU-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %s = call float @llvm.fmuladd.f32(float %a, float %b, float %c)
78; THRU-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v = call <16 x float> @llvm.fmuladd.v16f32(<16 x float> %va, <16 x float> %vb, <16 x float> %vc)
79; THRU-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
80;
81; LATE-LABEL: 'fmuladd'
82; LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %s = call float @llvm.fmuladd.f32(float %a, float %b, float %c)
83; LATE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v = call <16 x float> @llvm.fmuladd.v16f32(<16 x float> %va, <16 x float> %vb, <16 x float> %vc)
84; LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
85;
86; SIZE-LABEL: 'fmuladd'
87; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %s = call float @llvm.fmuladd.f32(float %a, float %b, float %c)
88; SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v = call <16 x float> @llvm.fmuladd.v16f32(<16 x float> %va, <16 x float> %vb, <16 x float> %vc)
89; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
90;
91; SIZE_LATE-LABEL: 'fmuladd'
92; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %s = call float @llvm.fmuladd.f32(float %a, float %b, float %c)
93; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v = call <16 x float> @llvm.fmuladd.v16f32(<16 x float> %va, <16 x float> %vb, <16 x float> %vc)
94; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
95;
96  %s = call float @llvm.fmuladd.f32(float %a, float %b, float %c)
97  %v = call <16 x float> @llvm.fmuladd.v16f32(<16 x float> %va, <16 x float> %vb, <16 x float> %vc)
98  ret void
99}
100
101define void @log2(float %a, <16 x float> %va) {
102; THRU-LABEL: 'log2'
103; THRU-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %s = call float @llvm.log2.f32(float %a)
104; THRU-NEXT:  Cost Model: Found an estimated cost of 192 for instruction: %v = call <16 x float> @llvm.log2.v16f32(<16 x float> %va)
105; THRU-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
106;
107; LATE-LABEL: 'log2'
108; LATE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %s = call float @llvm.log2.f32(float %a)
109; LATE-NEXT:  Cost Model: Found an estimated cost of 192 for instruction: %v = call <16 x float> @llvm.log2.v16f32(<16 x float> %va)
110; LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
111;
112; SIZE-LABEL: 'log2'
113; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %s = call float @llvm.log2.f32(float %a)
114; SIZE-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %v = call <16 x float> @llvm.log2.v16f32(<16 x float> %va)
115; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
116;
117; SIZE_LATE-LABEL: 'log2'
118; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %s = call float @llvm.log2.f32(float %a)
119; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 192 for instruction: %v = call <16 x float> @llvm.log2.v16f32(<16 x float> %va)
120; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
121;
122  %s = call float @llvm.log2.f32(float %a)
123  %v = call <16 x float> @llvm.log2.v16f32(<16 x float> %va)
124  ret void
125}
126
127define void @constrained_fadd(float %a, <16 x float> %va) strictfp {
128; THRU-LABEL: 'constrained_fadd'
129; THRU-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %s = call float @llvm.experimental.constrained.fadd.f32(float %a, float %a, metadata !"round.dynamic", metadata !"fpexcept.ignore")
130; THRU-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %t = call <16 x float> @llvm.experimental.constrained.fadd.v16f32(<16 x float> %va, <16 x float> %va, metadata !"round.dynamic", metadata !"fpexcept.ignore")
131; THRU-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
132;
133; LATE-LABEL: 'constrained_fadd'
134; LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %s = call float @llvm.experimental.constrained.fadd.f32(float %a, float %a, metadata !"round.dynamic", metadata !"fpexcept.ignore")
135; LATE-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %t = call <16 x float> @llvm.experimental.constrained.fadd.v16f32(<16 x float> %va, <16 x float> %va, metadata !"round.dynamic", metadata !"fpexcept.ignore")
136; LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
137;
138; SIZE-LABEL: 'constrained_fadd'
139; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %s = call float @llvm.experimental.constrained.fadd.f32(float %a, float %a, metadata !"round.dynamic", metadata !"fpexcept.ignore")
140; SIZE-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %t = call <16 x float> @llvm.experimental.constrained.fadd.v16f32(<16 x float> %va, <16 x float> %va, metadata !"round.dynamic", metadata !"fpexcept.ignore")
141; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
142;
143; SIZE_LATE-LABEL: 'constrained_fadd'
144; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %s = call float @llvm.experimental.constrained.fadd.f32(float %a, float %a, metadata !"round.dynamic", metadata !"fpexcept.ignore")
145; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %t = call <16 x float> @llvm.experimental.constrained.fadd.v16f32(<16 x float> %va, <16 x float> %va, metadata !"round.dynamic", metadata !"fpexcept.ignore")
146; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
147;
148  %s = call float @llvm.experimental.constrained.fadd.f32(float %a, float %a, metadata !"round.dynamic", metadata !"fpexcept.ignore")
149  %t = call <16 x float> @llvm.experimental.constrained.fadd.v16f32(<16 x float> %va, <16 x float> %va, metadata !"round.dynamic", metadata !"fpexcept.ignore")
150  ret void
151}
152
153define void @fmaximum(float %a, float %b, <16 x float> %va, <16 x float> %vb) {
154; THRU-LABEL: 'fmaximum'
155; THRU-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %s = call float @llvm.maximum.f32(float %a, float %b)
156; THRU-NEXT:  Cost Model: Found an estimated cost of 208 for instruction: %v = call <16 x float> @llvm.maximum.v16f32(<16 x float> %va, <16 x float> %vb)
157; THRU-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
158;
159; LATE-LABEL: 'fmaximum'
160; LATE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %s = call float @llvm.maximum.f32(float %a, float %b)
161; LATE-NEXT:  Cost Model: Found an estimated cost of 208 for instruction: %v = call <16 x float> @llvm.maximum.v16f32(<16 x float> %va, <16 x float> %vb)
162; LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
163;
164; SIZE-LABEL: 'fmaximum'
165; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %s = call float @llvm.maximum.f32(float %a, float %b)
166; SIZE-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %v = call <16 x float> @llvm.maximum.v16f32(<16 x float> %va, <16 x float> %vb)
167; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
168;
169; SIZE_LATE-LABEL: 'fmaximum'
170; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %s = call float @llvm.maximum.f32(float %a, float %b)
171; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 208 for instruction: %v = call <16 x float> @llvm.maximum.v16f32(<16 x float> %va, <16 x float> %vb)
172; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
173;
174  %s = call float @llvm.maximum.f32(float %a, float %b)
175  %v = call <16 x float> @llvm.maximum.v16f32(<16 x float> %va, <16 x float> %vb)
176  ret void
177}
178
179define void @cttz(i32 %a, <16 x i32> %va) {
180; THRU-LABEL: 'cttz'
181; THRU-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %s = call i32 @llvm.cttz.i32(i32 %a, i1 false)
182; THRU-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %va, i1 false)
183; THRU-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
184;
185; LATE-LABEL: 'cttz'
186; LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %s = call i32 @llvm.cttz.i32(i32 %a, i1 false)
187; LATE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %va, i1 false)
188; LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
189;
190; SIZE-LABEL: 'cttz'
191; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %s = call i32 @llvm.cttz.i32(i32 %a, i1 false)
192; SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %va, i1 false)
193; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
194;
195; SIZE_LATE-LABEL: 'cttz'
196; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %s = call i32 @llvm.cttz.i32(i32 %a, i1 false)
197; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %va, i1 false)
198; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
199;
200  %s = call i32 @llvm.cttz.i32(i32 %a, i1 false)
201  %v = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %va, i1 false)
202  ret void
203}
204
205define void @ctlz(i32 %a, <16 x i32> %va) {
206; THRU-LABEL: 'ctlz'
207; THRU-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %s = call i32 @llvm.ctlz.i32(i32 %a, i1 true)
208; THRU-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %va, i1 true)
209; THRU-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
210;
211; LATE-LABEL: 'ctlz'
212; LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %s = call i32 @llvm.ctlz.i32(i32 %a, i1 true)
213; LATE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %va, i1 true)
214; LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
215;
216; SIZE-LABEL: 'ctlz'
217; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %s = call i32 @llvm.ctlz.i32(i32 %a, i1 true)
218; SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %va, i1 true)
219; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
220;
221; SIZE_LATE-LABEL: 'ctlz'
222; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %s = call i32 @llvm.ctlz.i32(i32 %a, i1 true)
223; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %va, i1 true)
224; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
225;
226  %s = call i32 @llvm.ctlz.i32(i32 %a, i1 true)
227  %v = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %va, i1 true)
228  ret void
229}
230
231define void @fshl(i32 %a, i32 %b, i32 %c, <16 x i32> %va, <16 x i32> %vb, <16 x i32> %vc) {
232; THRU-LABEL: 'fshl'
233; THRU-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %s = call i32 @llvm.fshl.i32(i32 %a, i32 %b, i32 %c)
234; THRU-NEXT:  Cost Model: Found an estimated cost of 256 for instruction: %v = call <16 x i32> @llvm.fshl.v16i32(<16 x i32> %va, <16 x i32> %vb, <16 x i32> %vc)
235; THRU-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
236;
237; LATE-LABEL: 'fshl'
238; LATE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %s = call i32 @llvm.fshl.i32(i32 %a, i32 %b, i32 %c)
239; LATE-NEXT:  Cost Model: Found an estimated cost of 250 for instruction: %v = call <16 x i32> @llvm.fshl.v16i32(<16 x i32> %va, <16 x i32> %vb, <16 x i32> %vc)
240; LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
241;
242; SIZE-LABEL: 'fshl'
243; SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %s = call i32 @llvm.fshl.i32(i32 %a, i32 %b, i32 %c)
244; SIZE-NEXT:  Cost Model: Found an estimated cost of 229 for instruction: %v = call <16 x i32> @llvm.fshl.v16i32(<16 x i32> %va, <16 x i32> %vb, <16 x i32> %vc)
245; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
246;
247; SIZE_LATE-LABEL: 'fshl'
248; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %s = call i32 @llvm.fshl.i32(i32 %a, i32 %b, i32 %c)
249; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 250 for instruction: %v = call <16 x i32> @llvm.fshl.v16i32(<16 x i32> %va, <16 x i32> %vb, <16 x i32> %vc)
250; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
251;
252  %s = call i32 @llvm.fshl.i32(i32 %a, i32 %b, i32 %c)
253  %v = call <16 x i32> @llvm.fshl.v16i32(<16 x i32> %va, <16 x i32> %vb, <16 x i32> %vc)
254  ret void
255}
256
257define void @maskedgather(<16 x ptr> %va, <16 x i1> %vb, <16 x float> %vc) {
258; THRU-LABEL: 'maskedgather'
259; THRU-NEXT:  Cost Model: Found an estimated cost of 176 for instruction: %v = call <16 x float> @llvm.masked.gather.v16f32.v16p0(<16 x ptr> %va, i32 1, <16 x i1> %vb, <16 x float> %vc)
260; THRU-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
261;
262; LATE-LABEL: 'maskedgather'
263; LATE-NEXT:  Cost Model: Found an estimated cost of 176 for instruction: %v = call <16 x float> @llvm.masked.gather.v16f32.v16p0(<16 x ptr> %va, i32 1, <16 x i1> %vb, <16 x float> %vc)
264; LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
265;
266; SIZE-LABEL: 'maskedgather'
267; SIZE-NEXT:  Cost Model: Found an estimated cost of 176 for instruction: %v = call <16 x float> @llvm.masked.gather.v16f32.v16p0(<16 x ptr> %va, i32 1, <16 x i1> %vb, <16 x float> %vc)
268; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
269;
270; SIZE_LATE-LABEL: 'maskedgather'
271; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 176 for instruction: %v = call <16 x float> @llvm.masked.gather.v16f32.v16p0(<16 x ptr> %va, i32 1, <16 x i1> %vb, <16 x float> %vc)
272; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
273;
274  %v = call <16 x float> @llvm.masked.gather.v16f32.v16p0(<16 x ptr> %va, i32 1, <16 x i1> %vb, <16 x float> %vc)
275  ret void
276}
277
278define void @maskedscatter(<16 x float> %va, <16 x ptr> %vb, <16 x i1> %vc) {
279; THRU-LABEL: 'maskedscatter'
280; THRU-NEXT:  Cost Model: Found an estimated cost of 176 for instruction: call void @llvm.masked.scatter.v16f32.v16p0(<16 x float> %va, <16 x ptr> %vb, i32 1, <16 x i1> %vc)
281; THRU-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
282;
283; LATE-LABEL: 'maskedscatter'
284; LATE-NEXT:  Cost Model: Found an estimated cost of 176 for instruction: call void @llvm.masked.scatter.v16f32.v16p0(<16 x float> %va, <16 x ptr> %vb, i32 1, <16 x i1> %vc)
285; LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
286;
287; SIZE-LABEL: 'maskedscatter'
288; SIZE-NEXT:  Cost Model: Found an estimated cost of 176 for instruction: call void @llvm.masked.scatter.v16f32.v16p0(<16 x float> %va, <16 x ptr> %vb, i32 1, <16 x i1> %vc)
289; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
290;
291; SIZE_LATE-LABEL: 'maskedscatter'
292; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 176 for instruction: call void @llvm.masked.scatter.v16f32.v16p0(<16 x float> %va, <16 x ptr> %vb, i32 1, <16 x i1> %vc)
293; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
294;
295  call void @llvm.masked.scatter.v16f32.v16p0(<16 x float> %va, <16 x ptr> %vb, i32 1, <16 x i1> %vc)
296  ret void
297}
298
299define void @reduce_fmax(<16 x float> %va) {
300; THRU-LABEL: 'reduce_fmax'
301; THRU-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v = call float @llvm.vector.reduce.fmax.v16f32(<16 x float> %va)
302; THRU-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
303;
304; LATE-LABEL: 'reduce_fmax'
305; LATE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v = call float @llvm.vector.reduce.fmax.v16f32(<16 x float> %va)
306; LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
307;
308; SIZE-LABEL: 'reduce_fmax'
309; SIZE-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v = call float @llvm.vector.reduce.fmax.v16f32(<16 x float> %va)
310; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
311;
312; SIZE_LATE-LABEL: 'reduce_fmax'
313; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v = call float @llvm.vector.reduce.fmax.v16f32(<16 x float> %va)
314; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
315;
316  %v = call float @llvm.vector.reduce.fmax.v16f32(<16 x float> %va)
317  ret void
318}
319
320define void @memcpy(ptr %a, ptr %b, i32 %c) {
321; THRU-LABEL: 'memcpy'
322; THRU-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: call void @llvm.memcpy.p0.p0.i32(ptr align 1 %a, ptr align 1 %b, i32 32, i1 false)
323; THRU-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
324;
325; LATE-LABEL: 'memcpy'
326; LATE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: call void @llvm.memcpy.p0.p0.i32(ptr align 1 %a, ptr align 1 %b, i32 32, i1 false)
327; LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
328;
329; SIZE-LABEL: 'memcpy'
330; SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: call void @llvm.memcpy.p0.p0.i32(ptr align 1 %a, ptr align 1 %b, i32 32, i1 false)
331; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
332;
333; SIZE_LATE-LABEL: 'memcpy'
334; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: call void @llvm.memcpy.p0.p0.i32(ptr align 1 %a, ptr align 1 %b, i32 32, i1 false)
335; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
336;
337  call void @llvm.memcpy.p0.p0.i32(ptr align 1 %a, ptr align 1 %b, i32 32, i1 false)
338  ret void
339}
340
341define void @ssa_copy() {
342  ; CHECK: %{{.*}} = llvm.intr.ssa.copy %{{.*}} : f32
343; THRU-LABEL: 'ssa_copy'
344; THRU-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %i = call i32 @llvm.ssa.copy.i32(i32 undef)
345; THRU-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %f = call float @llvm.ssa.copy.f32(float undef)
346; THRU-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %p = call ptr @llvm.ssa.copy.p0(ptr undef)
347; THRU-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
348;
349; LATE-LABEL: 'ssa_copy'
350; LATE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %i = call i32 @llvm.ssa.copy.i32(i32 undef)
351; LATE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %f = call float @llvm.ssa.copy.f32(float undef)
352; LATE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %p = call ptr @llvm.ssa.copy.p0(ptr undef)
353; LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
354;
355; SIZE-LABEL: 'ssa_copy'
356; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %i = call i32 @llvm.ssa.copy.i32(i32 undef)
357; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %f = call float @llvm.ssa.copy.f32(float undef)
358; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %p = call ptr @llvm.ssa.copy.p0(ptr undef)
359; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
360;
361; SIZE_LATE-LABEL: 'ssa_copy'
362; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %i = call i32 @llvm.ssa.copy.i32(i32 undef)
363; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %f = call float @llvm.ssa.copy.f32(float undef)
364; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %p = call ptr @llvm.ssa.copy.p0(ptr undef)
365; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
366;
367  %i = call i32 @llvm.ssa.copy.i32(i32 undef)
368  %f = call float @llvm.ssa.copy.f32(float undef)
369  %p = call ptr @llvm.ssa.copy.p0(ptr undef)
370  ret void
371}
372