xref: /llvm-project/llvm/test/Analysis/CostModel/RISCV/rvv-phi-const.ll (revision 38fffa630ee80163dc65e759392ad29798905679)
1b87a0930SLuke Lau; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 2
2b87a0930SLuke Lau; RUN: opt < %s -mtriple=riscv64 -mattr=+v,+f,+d -disable-output -passes="print<cost-model>" 2>&1 | FileCheck %s
3b87a0930SLuke Lau
4b87a0930SLuke Laudefine <2 x i8> @phi_v2i8_small(i1 %c) {
5b87a0930SLuke Lau; CHECK-LABEL: 'phi_v2i8_small'
60a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
70a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
80a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
90a5d52a7SSergey Kachkov; 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 ]
100a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i8> %x
11b87a0930SLuke Lau;
12b87a0930SLuke Lau  br i1 %c, label %a, label %b
13b87a0930SLuke Laua:
14b87a0930SLuke Lau  br label %d
15b87a0930SLuke Laub:
16b87a0930SLuke Lau  br label %d
17b87a0930SLuke Laud:
18b87a0930SLuke Lau  %x = phi <2 x i8> [<i8 1, i8 -1>, %a], [<i8 -1, i8 1>, %b]
19b87a0930SLuke Lau  ret <2 x i8> %x
20b87a0930SLuke Lau}
21b87a0930SLuke Lau
22b87a0930SLuke Laudefine <4 x i8> @phi_v4i8_splat(i1 %c) {
23b87a0930SLuke Lau; CHECK-LABEL: 'phi_v4i8_splat'
240a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
250a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
260a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
27*38fffa63SPaul Walker; 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 ]
280a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %x
29b87a0930SLuke Lau;
30b87a0930SLuke Lau  br i1 %c, label %a, label %b
31b87a0930SLuke Laua:
32b87a0930SLuke Lau  br label %d
33b87a0930SLuke Laub:
34b87a0930SLuke Lau  br label %d
35b87a0930SLuke Laud:
36b87a0930SLuke Lau  %x = phi <4 x i8> [<i8 1, i8 1, i8 1, i8 1>, %a], [<i8 2, i8 2, i8 2, i8 2>, %b]
37b87a0930SLuke Lau  ret <4 x i8> %x
38b87a0930SLuke Lau}
39b87a0930SLuke Lau
40b87a0930SLuke Laudefine <4 x i8> @phi_v4i8_small(i1 %c) {
41b87a0930SLuke Lau; CHECK-LABEL: 'phi_v4i8_small'
420a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
430a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
440a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
450a5d52a7SSergey Kachkov; 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 ]
460a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %x
47b87a0930SLuke Lau;
48b87a0930SLuke Lau  br i1 %c, label %a, label %b
49b87a0930SLuke Laua:
50b87a0930SLuke Lau  br label %d
51b87a0930SLuke Laub:
52b87a0930SLuke Lau  br label %d
53b87a0930SLuke Laud:
54b87a0930SLuke Lau  %x = phi <4 x i8> [<i8 1, i8 2, i8 3, i8 4>, %a], [<i8 2, i8 4, i8 6, i8 8>, %b]
55b87a0930SLuke Lau  ret <4 x i8> %x
56b87a0930SLuke Lau}
57b87a0930SLuke Lau
58b87a0930SLuke Laudefine <4 x i8> @phi_v4i8_large(i1 %c) {
59b87a0930SLuke Lau; CHECK-LABEL: 'phi_v4i8_large'
600a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
610a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
620a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
630a5d52a7SSergey Kachkov; 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 ]
640a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %x
65b87a0930SLuke Lau;
66b87a0930SLuke Lau  br i1 %c, label %a, label %b
67b87a0930SLuke Laua:
68b87a0930SLuke Lau  br label %d
69b87a0930SLuke Laub:
70b87a0930SLuke Lau  br label %d
71b87a0930SLuke Laud:
72b87a0930SLuke Lau  %x = phi <4 x i8> [<i8 1234, i8 4321, i8 9999, i8 2378>, %a], [<i8 7432, i8 -4832, i8 381381, i8 12>, %b]
73b87a0930SLuke Lau  ret <4 x i8> %x
74b87a0930SLuke Lau}
75b87a0930SLuke Lau
76b87a0930SLuke Lau; The cost should be conservative and assume it will need to materialize the more expensive constant
77b87a0930SLuke Laudefine <4 x i8> @phi_v4i8_cheap_and_expensive(i1 %c) {
78b87a0930SLuke Lau; CHECK-LABEL: 'phi_v4i8_cheap_and_expensive'
790a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
800a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
810a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
82*38fffa63SPaul Walker; 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 ]
830a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %x
84b87a0930SLuke Lau;
85b87a0930SLuke Lau  br i1 %c, label %a, label %b
86b87a0930SLuke Laua:
87b87a0930SLuke Lau  br label %d
88b87a0930SLuke Laub:
89b87a0930SLuke Lau  br label %d
90b87a0930SLuke Laud:
91b87a0930SLuke Lau  %x = phi <4 x i8> [<i8 1, i8 1, i8 1, i8 1>, %a], [<i8 7432, i8 -4832, i8 381381, i8 12>, %b]
92b87a0930SLuke Lau  ret <4 x i8> %x
93b87a0930SLuke Lau}
94b87a0930SLuke Lau
95b87a0930SLuke Laudefine <4 x i16> @phi_v4i16_splat(i1 %c) {
96b87a0930SLuke Lau; CHECK-LABEL: 'phi_v4i16_splat'
970a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
980a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
990a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
100*38fffa63SPaul Walker; 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 ]
1010a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %x
102b87a0930SLuke Lau;
103b87a0930SLuke Lau  br i1 %c, label %a, label %b
104b87a0930SLuke Laua:
105b87a0930SLuke Lau  br label %d
106b87a0930SLuke Laub:
107b87a0930SLuke Lau  br label %d
108b87a0930SLuke Laud:
109b87a0930SLuke Lau  %x = phi <4 x i16> [<i16 1, i16 1, i16 1, i16 1>, %a], [<i16 2, i16 2, i16 2, i16 2>, %b]
110b87a0930SLuke Lau  ret <4 x i16> %x
111b87a0930SLuke Lau}
112b87a0930SLuke Lau
113b87a0930SLuke Laudefine <4 x i16> @phi_v4i16_small(i1 %c) {
114b87a0930SLuke Lau; CHECK-LABEL: 'phi_v4i16_small'
1150a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
1160a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
1170a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
1180a5d52a7SSergey Kachkov; 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 ]
1190a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %x
120b87a0930SLuke Lau;
121b87a0930SLuke Lau  br i1 %c, label %a, label %b
122b87a0930SLuke Laua:
123b87a0930SLuke Lau  br label %d
124b87a0930SLuke Laub:
125b87a0930SLuke Lau  br label %d
126b87a0930SLuke Laud:
127b87a0930SLuke Lau  %x = phi <4 x i16> [<i16 1, i16 2, i16 3, i16 4>, %a], [<i16 2, i16 4, i16 6, i16 8>, %b]
128b87a0930SLuke Lau  ret <4 x i16> %x
129b87a0930SLuke Lau}
130b87a0930SLuke Lau
131b87a0930SLuke Laudefine <4 x i16> @phi_v4i16_large(i1 %c) {
132b87a0930SLuke Lau; CHECK-LABEL: 'phi_v4i16_large'
1330a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
1340a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
1350a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
1360a5d52a7SSergey Kachkov; 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 ]
1370a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %x
138b87a0930SLuke Lau;
139b87a0930SLuke Lau  br i1 %c, label %a, label %b
140b87a0930SLuke Laua:
141b87a0930SLuke Lau  br label %d
142b87a0930SLuke Laub:
143b87a0930SLuke Lau  br label %d
144b87a0930SLuke Laud:
145b87a0930SLuke Lau  %x = phi <4 x i16> [<i16 1234, i16 4321, i16 9999, i16 2378>, %a], [<i16 7432, i16 -4832, i16 381381, i16 12>, %b]
146b87a0930SLuke Lau  ret <4 x i16> %x
147b87a0930SLuke Lau}
148b87a0930SLuke Lau
149b87a0930SLuke Lau; The cost should be conservative and assume it will need to materialize the more expensive constant
150b87a0930SLuke Laudefine <4 x i16> @phi_v4i16_cheap_and_expensive(i1 %c) {
151b87a0930SLuke Lau; CHECK-LABEL: 'phi_v4i16_cheap_and_expensive'
1520a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
1530a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
1540a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
155*38fffa63SPaul Walker; 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 ]
1560a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %x
157b87a0930SLuke Lau;
158b87a0930SLuke Lau  br i1 %c, label %a, label %b
159b87a0930SLuke Laua:
160b87a0930SLuke Lau  br label %d
161b87a0930SLuke Laub:
162b87a0930SLuke Lau  br label %d
163b87a0930SLuke Laud:
164b87a0930SLuke Lau  %x = phi <4 x i16> [<i16 1, i16 1, i16 1, i16 1>, %a], [<i16 7432, i16 -4832, i16 381381, i16 12>, %b]
165b87a0930SLuke Lau  ret <4 x i16> %x
166b87a0930SLuke Lau}
167b87a0930SLuke Lau
168b87a0930SLuke Laudefine <4 x i32> @phi_v4i32_splat(i1 %c) {
169b87a0930SLuke Lau; CHECK-LABEL: 'phi_v4i32_splat'
1700a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
1710a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
1720a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
173*38fffa63SPaul Walker; 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 ]
1740a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %x
175b87a0930SLuke Lau;
176b87a0930SLuke Lau  br i1 %c, label %a, label %b
177b87a0930SLuke Laua:
178b87a0930SLuke Lau  br label %d
179b87a0930SLuke Laub:
180b87a0930SLuke Lau  br label %d
181b87a0930SLuke Laud:
182b87a0930SLuke Lau  %x = phi <4 x i32> [<i32 1, i32 1, i32 1, i32 1>, %a], [<i32 2, i32 2, i32 2, i32 2>, %b]
183b87a0930SLuke Lau  ret <4 x i32> %x
184b87a0930SLuke Lau}
185b87a0930SLuke Lau
186b87a0930SLuke Laudefine <4 x i32> @phi_v4i32_small(i1 %c) {
187b87a0930SLuke Lau; CHECK-LABEL: 'phi_v4i32_small'
1880a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
1890a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
1900a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
1910a5d52a7SSergey Kachkov; 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 ]
1920a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %x
193b87a0930SLuke Lau;
194b87a0930SLuke Lau  br i1 %c, label %a, label %b
195b87a0930SLuke Laua:
196b87a0930SLuke Lau  br label %d
197b87a0930SLuke Laub:
198b87a0930SLuke Lau  br label %d
199b87a0930SLuke Laud:
200b87a0930SLuke Lau  %x = phi <4 x i32> [<i32 1, i32 2, i32 3, i32 4>, %a], [<i32 2, i32 4, i32 6, i32 8>, %b]
201b87a0930SLuke Lau  ret <4 x i32> %x
202b87a0930SLuke Lau}
203b87a0930SLuke Lau
204b87a0930SLuke Laudefine <4 x i32> @phi_v4i32_large(i1 %c) {
205b87a0930SLuke Lau; CHECK-LABEL: 'phi_v4i32_large'
2060a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
2070a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
2080a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
2090a5d52a7SSergey Kachkov; 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 ]
2100a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %x
211b87a0930SLuke Lau;
212b87a0930SLuke Lau  br i1 %c, label %a, label %b
213b87a0930SLuke Laua:
214b87a0930SLuke Lau  br label %d
215b87a0930SLuke Laub:
216b87a0930SLuke Lau  br label %d
217b87a0930SLuke Laud:
218b87a0930SLuke Lau  %x = phi <4 x i32> [<i32 1234, i32 4321, i32 9999, i32 2378>, %a], [<i32 7432, i32 -4832, i32 381381, i32 12>, %b]
219b87a0930SLuke Lau  ret <4 x i32> %x
220b87a0930SLuke Lau}
221b87a0930SLuke Lau
222b87a0930SLuke Lau; The cost should be conservative and assume it will need to materialize the more expensive constant
223b87a0930SLuke Laudefine <4 x i32> @phi_v4i32_cheap_and_expensive(i1 %c) {
224b87a0930SLuke Lau; CHECK-LABEL: 'phi_v4i32_cheap_and_expensive'
2250a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
2260a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
2270a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
228*38fffa63SPaul Walker; 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 ]
2290a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %x
230b87a0930SLuke Lau;
231b87a0930SLuke Lau  br i1 %c, label %a, label %b
232b87a0930SLuke Laua:
233b87a0930SLuke Lau  br label %d
234b87a0930SLuke Laub:
235b87a0930SLuke Lau  br label %d
236b87a0930SLuke Laud:
237b87a0930SLuke Lau  %x = phi <4 x i32> [<i32 1, i32 1, i32 1, i32 1>, %a], [<i32 7432, i32 -4832, i32 381381, i32 12>, %b]
238b87a0930SLuke Lau  ret <4 x i32> %x
239b87a0930SLuke Lau}
240b87a0930SLuke Lau
241b87a0930SLuke Laudefine <4 x i64> @phi_v4i64_splat(i1 %c) {
242b87a0930SLuke Lau; CHECK-LABEL: 'phi_v4i64_splat'
2430a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
2440a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
2450a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
246*38fffa63SPaul Walker; 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 ]
2470a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %x
248b87a0930SLuke Lau;
249b87a0930SLuke Lau  br i1 %c, label %a, label %b
250b87a0930SLuke Laua:
251b87a0930SLuke Lau  br label %d
252b87a0930SLuke Laub:
253b87a0930SLuke Lau  br label %d
254b87a0930SLuke Laud:
255b87a0930SLuke Lau  %x = phi <4 x i64> [<i64 1, i64 1, i64 1, i64 1>, %a], [<i64 2, i64 2, i64 2, i64 2>, %b]
256b87a0930SLuke Lau  ret <4 x i64> %x
257b87a0930SLuke Lau}
258b87a0930SLuke Lau
259b87a0930SLuke Laudefine <4 x i64> @phi_v4i64_small(i1 %c) {
260b87a0930SLuke Lau; CHECK-LABEL: 'phi_v4i64_small'
2610a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
2620a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
2630a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
2640a5d52a7SSergey Kachkov; 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 ]
2650a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %x
266b87a0930SLuke Lau;
267b87a0930SLuke Lau  br i1 %c, label %a, label %b
268b87a0930SLuke Laua:
269b87a0930SLuke Lau  br label %d
270b87a0930SLuke Laub:
271b87a0930SLuke Lau  br label %d
272b87a0930SLuke Laud:
273b87a0930SLuke Lau  %x = phi <4 x i64> [<i64 1, i64 2, i64 3, i64 4>, %a], [<i64 2, i64 4, i64 6, i64 8>, %b]
274b87a0930SLuke Lau  ret <4 x i64> %x
275b87a0930SLuke Lau}
276b87a0930SLuke Lau
277b87a0930SLuke Laudefine <4 x i64> @phi_v4i64_large(i1 %c) {
278b87a0930SLuke Lau; CHECK-LABEL: 'phi_v4i64_large'
2790a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
2800a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
2810a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
2820a5d52a7SSergey Kachkov; 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 ]
2830a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %x
284b87a0930SLuke Lau;
285b87a0930SLuke Lau  br i1 %c, label %a, label %b
286b87a0930SLuke Laua:
287b87a0930SLuke Lau  br label %d
288b87a0930SLuke Laub:
289b87a0930SLuke Lau  br label %d
290b87a0930SLuke Laud:
291b87a0930SLuke Lau  %x = phi <4 x i64> [<i64 1234, i64 4321, i64 9999, i64 2378>, %a], [<i64 7432, i64 -4832, i64 381381, i64 12>, %b]
292b87a0930SLuke Lau  ret <4 x i64> %x
293b87a0930SLuke Lau}
294b87a0930SLuke Lau
295b87a0930SLuke Lau; The cost should be conservative and assume it will need to materialize the more expensive constant
296b87a0930SLuke Laudefine <4 x i64> @phi_v4i64_cheap_and_expensive(i1 %c) {
297b87a0930SLuke Lau; CHECK-LABEL: 'phi_v4i64_cheap_and_expensive'
2980a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
2990a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
3000a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
301*38fffa63SPaul Walker; 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 ]
3020a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %x
303b87a0930SLuke Lau;
304b87a0930SLuke Lau  br i1 %c, label %a, label %b
305b87a0930SLuke Laua:
306b87a0930SLuke Lau  br label %d
307b87a0930SLuke Laub:
308b87a0930SLuke Lau  br label %d
309b87a0930SLuke Laud:
310b87a0930SLuke Lau  %x = phi <4 x i64> [<i64 1, i64 1, i64 1, i64 1>, %a], [<i64 7432, i64 -4832, i64 381381, i64 12>, %b]
311b87a0930SLuke Lau  ret <4 x i64> %x
312b87a0930SLuke Lau}
313b87a0930SLuke Lau
314b87a0930SLuke Laudefine <4 x half> @phi_v4f16_splat(i1 %c) {
315b87a0930SLuke Lau; CHECK-LABEL: 'phi_v4f16_splat'
3160a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
3170a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
3180a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
319*38fffa63SPaul Walker; 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 ]
3200a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x half> %x
321b87a0930SLuke Lau;
322b87a0930SLuke Lau  br i1 %c, label %a, label %b
323b87a0930SLuke Laua:
324b87a0930SLuke Lau  br label %d
325b87a0930SLuke Laub:
326b87a0930SLuke Lau  br label %d
327b87a0930SLuke Laud:
328b87a0930SLuke Lau  %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]
329b87a0930SLuke Lau  ret <4 x half> %x
330b87a0930SLuke Lau}
331b87a0930SLuke Lau
332b87a0930SLuke Laudefine <4 x half> @phi_v4f16(i1 %c) {
333b87a0930SLuke Lau; CHECK-LABEL: 'phi_v4f16'
3340a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
3350a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
3360a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
3370a5d52a7SSergey Kachkov; 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 ]
3380a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x half> %x
339b87a0930SLuke Lau;
340b87a0930SLuke Lau  br i1 %c, label %a, label %b
341b87a0930SLuke Laua:
342b87a0930SLuke Lau  br label %d
343b87a0930SLuke Laub:
344b87a0930SLuke Lau  br label %d
345b87a0930SLuke Laud:
346b87a0930SLuke Lau  %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]
347b87a0930SLuke Lau  ret <4 x half> %x
348b87a0930SLuke Lau}
349b87a0930SLuke Lau
350b87a0930SLuke Lau; The cost should be conservative and assume it will need to materialize the more expensive constant
351b87a0930SLuke Laudefine <4 x half> @phi_v4f16_cheap_and_expensive(i1 %c) {
352b87a0930SLuke Lau; CHECK-LABEL: 'phi_v4f16_cheap_and_expensive'
3530a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
3540a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
3550a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
356*38fffa63SPaul Walker; 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 ]
3570a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x half> %x
358b87a0930SLuke Lau;
359b87a0930SLuke Lau  br i1 %c, label %a, label %b
360b87a0930SLuke Laua:
361b87a0930SLuke Lau  br label %d
362b87a0930SLuke Laub:
363b87a0930SLuke Lau  br label %d
364b87a0930SLuke Laud:
365b87a0930SLuke Lau  %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]
366b87a0930SLuke Lau  ret <4 x half> %x
367b87a0930SLuke Lau}
368b87a0930SLuke Lau
369b87a0930SLuke Laudefine <4 x float> @phi_v4f32_splat(i1 %c) {
370b87a0930SLuke Lau; CHECK-LABEL: 'phi_v4f32_splat'
3710a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
3720a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
3730a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
374*38fffa63SPaul Walker; 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 ]
3750a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x float> %x
376b87a0930SLuke Lau;
377b87a0930SLuke Lau  br i1 %c, label %a, label %b
378b87a0930SLuke Laua:
379b87a0930SLuke Lau  br label %d
380b87a0930SLuke Laub:
381b87a0930SLuke Lau  br label %d
382b87a0930SLuke Laud:
383b87a0930SLuke Lau  %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]
384b87a0930SLuke Lau  ret <4 x float> %x
385b87a0930SLuke Lau}
386b87a0930SLuke Lau
387b87a0930SLuke Laudefine <4 x float> @phi_v4f32(i1 %c) {
388b87a0930SLuke Lau; CHECK-LABEL: 'phi_v4f32'
3890a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
3900a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
3910a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
3920a5d52a7SSergey Kachkov; 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 ]
3930a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x float> %x
394b87a0930SLuke Lau;
395b87a0930SLuke Lau  br i1 %c, label %a, label %b
396b87a0930SLuke Laua:
397b87a0930SLuke Lau  br label %d
398b87a0930SLuke Laub:
399b87a0930SLuke Lau  br label %d
400b87a0930SLuke Laud:
401b87a0930SLuke Lau  %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]
402b87a0930SLuke Lau  ret <4 x float> %x
403b87a0930SLuke Lau}
404b87a0930SLuke Lau
405b87a0930SLuke Lau; The cost should be conservative and assume it will need to materialize the more expensive constant
406b87a0930SLuke Laudefine <4 x float> @phi_v4f32_cheap_and_expensive(i1 %c) {
407b87a0930SLuke Lau; CHECK-LABEL: 'phi_v4f32_cheap_and_expensive'
4080a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
4090a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
4100a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
411*38fffa63SPaul Walker; 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 ]
4120a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x float> %x
413b87a0930SLuke Lau;
414b87a0930SLuke Lau  br i1 %c, label %a, label %b
415b87a0930SLuke Laua:
416b87a0930SLuke Lau  br label %d
417b87a0930SLuke Laub:
418b87a0930SLuke Lau  br label %d
419b87a0930SLuke Laud:
420b87a0930SLuke Lau  %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]
421b87a0930SLuke Lau  ret <4 x float> %x
422b87a0930SLuke Lau}
423b87a0930SLuke Lau
424b87a0930SLuke Laudefine <4 x double> @phi_v4f64_splat(i1 %c) {
425b87a0930SLuke Lau; CHECK-LABEL: 'phi_v4f64_splat'
4260a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
4270a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
4280a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
429*38fffa63SPaul Walker; 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 ]
4300a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x double> %x
431b87a0930SLuke Lau;
432b87a0930SLuke Lau  br i1 %c, label %a, label %b
433b87a0930SLuke Laua:
434b87a0930SLuke Lau  br label %d
435b87a0930SLuke Laub:
436b87a0930SLuke Lau  br label %d
437b87a0930SLuke Laud:
438b87a0930SLuke Lau  %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]
439b87a0930SLuke Lau  ret <4 x double> %x
440b87a0930SLuke Lau}
441b87a0930SLuke Lau
442b87a0930SLuke Laudefine <4 x double> @phi_v4f64(i1 %c) {
443b87a0930SLuke Lau; CHECK-LABEL: 'phi_v4f64'
4440a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
4450a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
4460a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
4470a5d52a7SSergey Kachkov; 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 ]
4480a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x double> %x
449b87a0930SLuke Lau;
450b87a0930SLuke Lau  br i1 %c, label %a, label %b
451b87a0930SLuke Laua:
452b87a0930SLuke Lau  br label %d
453b87a0930SLuke Laub:
454b87a0930SLuke Lau  br label %d
455b87a0930SLuke Laud:
456b87a0930SLuke Lau  %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]
457b87a0930SLuke Lau  ret <4 x double> %x
458b87a0930SLuke Lau}
459b87a0930SLuke Lau
460b87a0930SLuke Lau; The cost should be conservative and assume it will need to materialize the more expensive constant
461b87a0930SLuke Laudefine <4 x double> @phi_v4f64_cheap_and_expensive(i1 %c) {
462b87a0930SLuke Lau; CHECK-LABEL: 'phi_v4f64_cheap_and_expensive'
4630a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b
4640a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
4650a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %d
466*38fffa63SPaul Walker; 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 ]
4670a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x double> %x
468b87a0930SLuke Lau;
469b87a0930SLuke Lau  br i1 %c, label %a, label %b
470b87a0930SLuke Laua:
471b87a0930SLuke Lau  br label %d
472b87a0930SLuke Laub:
473b87a0930SLuke Lau  br label %d
474b87a0930SLuke Laud:
475b87a0930SLuke Lau  %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]
476b87a0930SLuke Lau  ret <4 x double> %x
477b87a0930SLuke Lau}
478