1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
|
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 2
; RUN: opt < %s -mtriple=riscv64 -mattr=+v,+f,+d -disable-output -passes="print<cost-model>" 2>&1 | FileCheck %s
define <2 x i8> @phi_v2i8_small(i1 %c) {
; CHECK-LABEL: 'phi_v2i8_small'
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <2 x i8> [ <i8 1, i8 -1>, %a ], [ <i8 -1, i8 1>, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i8> %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi <2 x i8> [<i8 1, i8 -1>, %a], [<i8 -1, i8 1>, %b]
ret <2 x i8> %x
}
define <4 x i8> @phi_v4i8_splat(i1 %c) {
; CHECK-LABEL: 'phi_v4i8_splat'
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i8> [ splat (i8 1), %a ], [ splat (i8 2), %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi <4 x i8> [<i8 1, i8 1, i8 1, i8 1>, %a], [<i8 2, i8 2, i8 2, i8 2>, %b]
ret <4 x i8> %x
}
define <4 x i8> @phi_v4i8_small(i1 %c) {
; CHECK-LABEL: 'phi_v4i8_small'
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i8> [ <i8 1, i8 2, i8 3, i8 4>, %a ], [ <i8 2, i8 4, i8 6, i8 8>, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi <4 x i8> [<i8 1, i8 2, i8 3, i8 4>, %a], [<i8 2, i8 4, i8 6, i8 8>, %b]
ret <4 x i8> %x
}
define <4 x i8> @phi_v4i8_large(i1 %c) {
; CHECK-LABEL: 'phi_v4i8_large'
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i8> [ <i8 -46, i8 -31, i8 15, i8 74>, %a ], [ <i8 8, i8 32, i8 -59, i8 12>, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi <4 x i8> [<i8 1234, i8 4321, i8 9999, i8 2378>, %a], [<i8 7432, i8 -4832, i8 381381, i8 12>, %b]
ret <4 x i8> %x
}
; The cost should be conservative and assume it will need to materialize the more expensive constant
define <4 x i8> @phi_v4i8_cheap_and_expensive(i1 %c) {
; CHECK-LABEL: 'phi_v4i8_cheap_and_expensive'
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i8> [ splat (i8 1), %a ], [ <i8 8, i8 32, i8 -59, i8 12>, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi <4 x i8> [<i8 1, i8 1, i8 1, i8 1>, %a], [<i8 7432, i8 -4832, i8 381381, i8 12>, %b]
ret <4 x i8> %x
}
define <4 x i16> @phi_v4i16_splat(i1 %c) {
; CHECK-LABEL: 'phi_v4i16_splat'
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i16> [ splat (i16 1), %a ], [ splat (i16 2), %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi <4 x i16> [<i16 1, i16 1, i16 1, i16 1>, %a], [<i16 2, i16 2, i16 2, i16 2>, %b]
ret <4 x i16> %x
}
define <4 x i16> @phi_v4i16_small(i1 %c) {
; CHECK-LABEL: 'phi_v4i16_small'
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i16> [ <i16 1, i16 2, i16 3, i16 4>, %a ], [ <i16 2, i16 4, i16 6, i16 8>, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi <4 x i16> [<i16 1, i16 2, i16 3, i16 4>, %a], [<i16 2, i16 4, i16 6, i16 8>, %b]
ret <4 x i16> %x
}
define <4 x i16> @phi_v4i16_large(i1 %c) {
; CHECK-LABEL: 'phi_v4i16_large'
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i16> [ <i16 1234, i16 4321, i16 9999, i16 2378>, %a ], [ <i16 7432, i16 -4832, i16 -11835, i16 12>, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi <4 x i16> [<i16 1234, i16 4321, i16 9999, i16 2378>, %a], [<i16 7432, i16 -4832, i16 381381, i16 12>, %b]
ret <4 x i16> %x
}
; The cost should be conservative and assume it will need to materialize the more expensive constant
define <4 x i16> @phi_v4i16_cheap_and_expensive(i1 %c) {
; CHECK-LABEL: 'phi_v4i16_cheap_and_expensive'
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i16> [ splat (i16 1), %a ], [ <i16 7432, i16 -4832, i16 -11835, i16 12>, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi <4 x i16> [<i16 1, i16 1, i16 1, i16 1>, %a], [<i16 7432, i16 -4832, i16 381381, i16 12>, %b]
ret <4 x i16> %x
}
define <4 x i32> @phi_v4i32_splat(i1 %c) {
; CHECK-LABEL: 'phi_v4i32_splat'
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i32> [ splat (i32 1), %a ], [ splat (i32 2), %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi <4 x i32> [<i32 1, i32 1, i32 1, i32 1>, %a], [<i32 2, i32 2, i32 2, i32 2>, %b]
ret <4 x i32> %x
}
define <4 x i32> @phi_v4i32_small(i1 %c) {
; CHECK-LABEL: 'phi_v4i32_small'
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %a ], [ <i32 2, i32 4, i32 6, i32 8>, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi <4 x i32> [<i32 1, i32 2, i32 3, i32 4>, %a], [<i32 2, i32 4, i32 6, i32 8>, %b]
ret <4 x i32> %x
}
define <4 x i32> @phi_v4i32_large(i1 %c) {
; CHECK-LABEL: 'phi_v4i32_large'
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i32> [ <i32 1234, i32 4321, i32 9999, i32 2378>, %a ], [ <i32 7432, i32 -4832, i32 381381, i32 12>, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi <4 x i32> [<i32 1234, i32 4321, i32 9999, i32 2378>, %a], [<i32 7432, i32 -4832, i32 381381, i32 12>, %b]
ret <4 x i32> %x
}
; The cost should be conservative and assume it will need to materialize the more expensive constant
define <4 x i32> @phi_v4i32_cheap_and_expensive(i1 %c) {
; CHECK-LABEL: 'phi_v4i32_cheap_and_expensive'
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i32> [ splat (i32 1), %a ], [ <i32 7432, i32 -4832, i32 381381, i32 12>, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi <4 x i32> [<i32 1, i32 1, i32 1, i32 1>, %a], [<i32 7432, i32 -4832, i32 381381, i32 12>, %b]
ret <4 x i32> %x
}
define <4 x i64> @phi_v4i64_splat(i1 %c) {
; CHECK-LABEL: 'phi_v4i64_splat'
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i64> [ splat (i64 1), %a ], [ splat (i64 2), %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi <4 x i64> [<i64 1, i64 1, i64 1, i64 1>, %a], [<i64 2, i64 2, i64 2, i64 2>, %b]
ret <4 x i64> %x
}
define <4 x i64> @phi_v4i64_small(i1 %c) {
; CHECK-LABEL: 'phi_v4i64_small'
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i64> [ <i64 1, i64 2, i64 3, i64 4>, %a ], [ <i64 2, i64 4, i64 6, i64 8>, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi <4 x i64> [<i64 1, i64 2, i64 3, i64 4>, %a], [<i64 2, i64 4, i64 6, i64 8>, %b]
ret <4 x i64> %x
}
define <4 x i64> @phi_v4i64_large(i1 %c) {
; CHECK-LABEL: 'phi_v4i64_large'
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i64> [ <i64 1234, i64 4321, i64 9999, i64 2378>, %a ], [ <i64 7432, i64 -4832, i64 381381, i64 12>, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi <4 x i64> [<i64 1234, i64 4321, i64 9999, i64 2378>, %a], [<i64 7432, i64 -4832, i64 381381, i64 12>, %b]
ret <4 x i64> %x
}
; The cost should be conservative and assume it will need to materialize the more expensive constant
define <4 x i64> @phi_v4i64_cheap_and_expensive(i1 %c) {
; CHECK-LABEL: 'phi_v4i64_cheap_and_expensive'
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x i64> [ splat (i64 1), %a ], [ <i64 7432, i64 -4832, i64 381381, i64 12>, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi <4 x i64> [<i64 1, i64 1, i64 1, i64 1>, %a], [<i64 7432, i64 -4832, i64 381381, i64 12>, %b]
ret <4 x i64> %x
}
define <4 x half> @phi_v4f16_splat(i1 %c) {
; CHECK-LABEL: 'phi_v4f16_splat'
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x half> [ splat (half 0xH3C00), %a ], [ <half 0xH4000, half 0xH4000, half 0xH4000, half 0xH4D00>, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x half> %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi <4 x half> [<half 1.0, half 1.0, half 1.0, half 1.0>, %a], [<half 2.0, half 2.0, half 2.0, half 20.>, %b]
ret <4 x half> %x
}
define <4 x half> @phi_v4f16(i1 %c) {
; CHECK-LABEL: 'phi_v4f16'
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x half> [ <half 0xH3C00, half 0xH4000, half 0xH4200, half 0xH4400>, %a ], [ <half 0xH4000, half 0xH4400, half 0xH4600, half 0xH4800>, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x half> %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi <4 x half> [<half 1.0, half 2.0, half 3.0, half 4.0>, %a], [<half 2.0, half 4.0, half 6.0, half 8.0>, %b]
ret <4 x half> %x
}
; The cost should be conservative and assume it will need to materialize the more expensive constant
define <4 x half> @phi_v4f16_cheap_and_expensive(i1 %c) {
; CHECK-LABEL: 'phi_v4f16_cheap_and_expensive'
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x half> [ splat (half 0xH3C00), %a ], [ <half 0xH6F42, half 0xHECB8, half 0xH5DF6, half 0xH4A40>, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x half> %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi <4 x half> [<half 1.0, half 1.0, half 1.0, half 1.0>, %a], [<half 7432.0, half -4832.0, half 381.5, half 12.5>, %b]
ret <4 x half> %x
}
define <4 x float> @phi_v4f32_splat(i1 %c) {
; CHECK-LABEL: 'phi_v4f32_splat'
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x float> [ splat (float 1.000000e+00), %a ], [ <float 2.000000e+00, float 2.000000e+00, float 2.000000e+00, float 2.000000e+01>, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x float> %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi <4 x float> [<float 1.0, float 1.0, float 1.0, float 1.0>, %a], [<float 2.0, float 2.0, float 2.0, float 20.>, %b]
ret <4 x float> %x
}
define <4 x float> @phi_v4f32(i1 %c) {
; CHECK-LABEL: 'phi_v4f32'
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x float> [ <float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00>, %a ], [ <float 2.000000e+00, float 4.000000e+00, float 6.000000e+00, float 8.000000e+00>, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x float> %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi <4 x float> [<float 1.0, float 2.0, float 3.0, float 4.0>, %a], [<float 2.0, float 4.0, float 6.0, float 8.0>, %b]
ret <4 x float> %x
}
; The cost should be conservative and assume it will need to materialize the more expensive constant
define <4 x float> @phi_v4f32_cheap_and_expensive(i1 %c) {
; CHECK-LABEL: 'phi_v4f32_cheap_and_expensive'
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x float> [ splat (float 1.000000e+00), %a ], [ <float 7.432000e+03, float -4.832000e+03, float 3.815000e+02, float 1.250000e+01>, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x float> %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi <4 x float> [<float 1.0, float 1.0, float 1.0, float 1.0>, %a], [<float 7432.0, float -4832.0, float 381.5, float 12.5>, %b]
ret <4 x float> %x
}
define <4 x double> @phi_v4f64_splat(i1 %c) {
; CHECK-LABEL: 'phi_v4f64_splat'
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x double> [ splat (double 1.000000e+00), %a ], [ <double 2.000000e+00, double 2.000000e+00, double 2.000000e+00, double 2.000000e+01>, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x double> %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi <4 x double> [<double 1.0, double 1.0, double 1.0, double 1.0>, %a], [<double 2.0, double 2.0, double 2.0, double 20.>, %b]
ret <4 x double> %x
}
define <4 x double> @phi_v4f64(i1 %c) {
; CHECK-LABEL: 'phi_v4f64'
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x double> [ <double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00>, %a ], [ <double 2.000000e+00, double 4.000000e+00, double 6.000000e+00, double 8.000000e+00>, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x double> %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi <4 x double> [<double 1.0, double 2.0, double 3.0, double 4.0>, %a], [<double 2.0, double 4.0, double 6.0, double 8.0>, %b]
ret <4 x double> %x
}
; The cost should be conservative and assume it will need to materialize the more expensive constant
define <4 x double> @phi_v4f64_cheap_and_expensive(i1 %c) {
; CHECK-LABEL: 'phi_v4f64_cheap_and_expensive'
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi <4 x double> [ splat (double 1.000000e+00), %a ], [ <double 7.432000e+03, double -4.832000e+03, double 3.815000e+02, double 1.250000e+01>, %b ]
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x double> %x
;
br i1 %c, label %a, label %b
a:
br label %d
b:
br label %d
d:
%x = phi <4 x double> [<double 1.0, double 1.0, double 1.0, double 1.0>, %a], [<double 7432.0, double -4832.0, double 381.5, double 12.5>, %b]
ret <4 x double> %x
}
|