1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2 ; RUN: opt -cost-model -analyze -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx1010 < %s | FileCheck -check-prefixes=ALL,FAST %s
3 ; RUN: opt -cost-model -analyze -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx90a < %s | FileCheck -check-prefixes=ALL,FAST %s
4 ; RUN: opt -cost-model -analyze -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx900 < %s | FileCheck -check-prefixes=ALL,FAST %s
5 ; RUN: opt -cost-model -analyze -mtriple=amdgcn-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL,SLOW %s
7 ; RUN: opt -cost-model -cost-kind=code-size -analyze -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx1010 < %s | FileCheck -check-prefixes=ALL-SIZE,FAST-SIZE %s
8 ; RUN: opt -cost-model -cost-kind=code-size -analyze -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx90a < %s | FileCheck -check-prefixes=ALL-SIZE,FAST-SIZE %s
9 ; RUN: opt -cost-model -cost-kind=code-size -analyze -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx900 < %s | FileCheck -check-prefixes=ALL-SIZE,FAST-SIZE %s
10 ; RUN: opt -cost-model -cost-kind=code-size -analyze -mtriple=amdgcn-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL-SIZE,SLOW-SIZE %s
13 define i32 @add(i32 %arg) {
14 ; -- Same size registeres --
16 ; ALL-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %A = zext <4 x i1> undef to <4 x i32>
17 ; ALL-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %B = sext <4 x i1> undef to <4 x i32>
18 ; ALL-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %C = trunc <4 x i32> undef to <4 x i1>
19 ; ALL-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %D = zext <8 x i1> undef to <8 x i32>
20 ; ALL-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %E = sext <8 x i1> undef to <8 x i32>
21 ; ALL-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %F = trunc <8 x i32> undef to <8 x i1>
22 ; ALL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %G = zext i1 undef to i32
23 ; ALL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %H = trunc i32 undef to i1
24 ; ALL-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret i32 undef
26 ; ALL-SIZE-LABEL: 'add'
27 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %A = zext <4 x i1> undef to <4 x i32>
28 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %B = sext <4 x i1> undef to <4 x i32>
29 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %C = trunc <4 x i32> undef to <4 x i1>
30 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %D = zext <8 x i1> undef to <8 x i32>
31 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %E = sext <8 x i1> undef to <8 x i32>
32 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %F = trunc <8 x i32> undef to <8 x i1>
33 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %G = zext i1 undef to i32
34 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %H = trunc i32 undef to i1
35 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef
37 %A = zext <4 x i1> undef to <4 x i32>
38 %B = sext <4 x i1> undef to <4 x i32>
39 %C = trunc <4 x i32> undef to <4 x i1>
41 ; -- Different size registers --
42 %D = zext <8 x i1> undef to <8 x i32>
43 %E = sext <8 x i1> undef to <8 x i32>
44 %F = trunc <8 x i32> undef to <8 x i1>
47 %G = zext i1 undef to i32
48 %H = trunc i32 undef to i1
53 define i32 @zext_sext(<8 x i1> %in) {
54 ; FAST-LABEL: 'zext_sext'
55 ; FAST-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %Z = zext <8 x i1> %in to <8 x i32>
56 ; FAST-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %S = sext <8 x i1> %in to <8 x i32>
57 ; FAST-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %A1 = zext <16 x i8> undef to <16 x i16>
58 ; FAST-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %A2 = sext <16 x i8> undef to <16 x i16>
59 ; FAST-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %A = sext <8 x i16> undef to <8 x i32>
60 ; FAST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %B = zext <8 x i16> undef to <8 x i32>
61 ; FAST-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %C = sext <4 x i32> undef to <4 x i64>
62 ; FAST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %C.v8i8.z = zext <8 x i8> undef to <8 x i32>
63 ; FAST-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %C.v8i8.s = sext <8 x i8> undef to <8 x i32>
64 ; FAST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %C.v4i16.z = zext <4 x i16> undef to <4 x i64>
65 ; FAST-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %C.v4i16.s = sext <4 x i16> undef to <4 x i64>
66 ; FAST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %C.v4i8.z = zext <4 x i8> undef to <4 x i64>
67 ; FAST-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %C.v4i8.s = sext <4 x i8> undef to <4 x i64>
68 ; FAST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %D = zext <4 x i32> undef to <4 x i64>
69 ; FAST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %D1 = zext <8 x i32> undef to <8 x i64>
70 ; FAST-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %D2 = sext <8 x i32> undef to <8 x i64>
71 ; FAST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %D3 = zext <16 x i16> undef to <16 x i32>
72 ; FAST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %D4 = zext <16 x i8> undef to <16 x i32>
73 ; FAST-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %D5 = zext <16 x i1> undef to <16 x i32>
74 ; FAST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %E = trunc <4 x i64> undef to <4 x i32>
75 ; FAST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %F = trunc <8 x i32> undef to <8 x i16>
76 ; FAST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %F1 = trunc <16 x i16> undef to <16 x i8>
77 ; FAST-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %F2 = trunc <8 x i32> undef to <8 x i8>
78 ; FAST-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %F3 = trunc <4 x i64> undef to <4 x i8>
79 ; FAST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %G = trunc <8 x i64> undef to <8 x i32>
80 ; FAST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %G1 = trunc <16 x i32> undef to <16 x i16>
81 ; FAST-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %G2 = trunc <16 x i32> undef to <16 x i8>
82 ; FAST-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret i32 undef
84 ; SLOW-LABEL: 'zext_sext'
85 ; SLOW-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %Z = zext <8 x i1> %in to <8 x i32>
86 ; SLOW-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %S = sext <8 x i1> %in to <8 x i32>
87 ; SLOW-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %A1 = zext <16 x i8> undef to <16 x i16>
88 ; SLOW-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %A2 = sext <16 x i8> undef to <16 x i16>
89 ; SLOW-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %A = sext <8 x i16> undef to <8 x i32>
90 ; SLOW-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %B = zext <8 x i16> undef to <8 x i32>
91 ; SLOW-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %C = sext <4 x i32> undef to <4 x i64>
92 ; SLOW-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %C.v8i8.z = zext <8 x i8> undef to <8 x i32>
93 ; SLOW-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %C.v8i8.s = sext <8 x i8> undef to <8 x i32>
94 ; SLOW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %C.v4i16.z = zext <4 x i16> undef to <4 x i64>
95 ; SLOW-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %C.v4i16.s = sext <4 x i16> undef to <4 x i64>
96 ; SLOW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %C.v4i8.z = zext <4 x i8> undef to <4 x i64>
97 ; SLOW-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %C.v4i8.s = sext <4 x i8> undef to <4 x i64>
98 ; SLOW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %D = zext <4 x i32> undef to <4 x i64>
99 ; SLOW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %D1 = zext <8 x i32> undef to <8 x i64>
100 ; SLOW-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %D2 = sext <8 x i32> undef to <8 x i64>
101 ; SLOW-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %D3 = zext <16 x i16> undef to <16 x i32>
102 ; SLOW-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %D4 = zext <16 x i8> undef to <16 x i32>
103 ; SLOW-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %D5 = zext <16 x i1> undef to <16 x i32>
104 ; SLOW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %E = trunc <4 x i64> undef to <4 x i32>
105 ; SLOW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %F = trunc <8 x i32> undef to <8 x i16>
106 ; SLOW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %F1 = trunc <16 x i16> undef to <16 x i8>
107 ; SLOW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %F2 = trunc <8 x i32> undef to <8 x i8>
108 ; SLOW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %F3 = trunc <4 x i64> undef to <4 x i8>
109 ; SLOW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %G = trunc <8 x i64> undef to <8 x i32>
110 ; SLOW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %G1 = trunc <16 x i32> undef to <16 x i16>
111 ; SLOW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %G2 = trunc <16 x i32> undef to <16 x i8>
112 ; SLOW-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret i32 undef
114 ; FAST-SIZE-LABEL: 'zext_sext'
115 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %Z = zext <8 x i1> %in to <8 x i32>
116 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %S = sext <8 x i1> %in to <8 x i32>
117 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %A1 = zext <16 x i8> undef to <16 x i16>
118 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %A2 = sext <16 x i8> undef to <16 x i16>
119 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %A = sext <8 x i16> undef to <8 x i32>
120 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %B = zext <8 x i16> undef to <8 x i32>
121 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %C = sext <4 x i32> undef to <4 x i64>
122 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %C.v8i8.z = zext <8 x i8> undef to <8 x i32>
123 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %C.v8i8.s = sext <8 x i8> undef to <8 x i32>
124 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %C.v4i16.z = zext <4 x i16> undef to <4 x i64>
125 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %C.v4i16.s = sext <4 x i16> undef to <4 x i64>
126 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %C.v4i8.z = zext <4 x i8> undef to <4 x i64>
127 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %C.v4i8.s = sext <4 x i8> undef to <4 x i64>
128 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %D = zext <4 x i32> undef to <4 x i64>
129 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %D1 = zext <8 x i32> undef to <8 x i64>
130 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %D2 = sext <8 x i32> undef to <8 x i64>
131 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %D3 = zext <16 x i16> undef to <16 x i32>
132 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %D4 = zext <16 x i8> undef to <16 x i32>
133 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %D5 = zext <16 x i1> undef to <16 x i32>
134 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %E = trunc <4 x i64> undef to <4 x i32>
135 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %F = trunc <8 x i32> undef to <8 x i16>
136 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %F1 = trunc <16 x i16> undef to <16 x i8>
137 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %F2 = trunc <8 x i32> undef to <8 x i8>
138 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %F3 = trunc <4 x i64> undef to <4 x i8>
139 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %G = trunc <8 x i64> undef to <8 x i32>
140 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %G1 = trunc <16 x i32> undef to <16 x i16>
141 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %G2 = trunc <16 x i32> undef to <16 x i8>
142 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef
144 ; SLOW-SIZE-LABEL: 'zext_sext'
145 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %Z = zext <8 x i1> %in to <8 x i32>
146 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %S = sext <8 x i1> %in to <8 x i32>
147 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %A1 = zext <16 x i8> undef to <16 x i16>
148 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %A2 = sext <16 x i8> undef to <16 x i16>
149 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %A = sext <8 x i16> undef to <8 x i32>
150 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %B = zext <8 x i16> undef to <8 x i32>
151 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %C = sext <4 x i32> undef to <4 x i64>
152 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %C.v8i8.z = zext <8 x i8> undef to <8 x i32>
153 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %C.v8i8.s = sext <8 x i8> undef to <8 x i32>
154 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %C.v4i16.z = zext <4 x i16> undef to <4 x i64>
155 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %C.v4i16.s = sext <4 x i16> undef to <4 x i64>
156 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %C.v4i8.z = zext <4 x i8> undef to <4 x i64>
157 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %C.v4i8.s = sext <4 x i8> undef to <4 x i64>
158 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %D = zext <4 x i32> undef to <4 x i64>
159 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %D1 = zext <8 x i32> undef to <8 x i64>
160 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %D2 = sext <8 x i32> undef to <8 x i64>
161 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %D3 = zext <16 x i16> undef to <16 x i32>
162 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %D4 = zext <16 x i8> undef to <16 x i32>
163 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %D5 = zext <16 x i1> undef to <16 x i32>
164 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %E = trunc <4 x i64> undef to <4 x i32>
165 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %F = trunc <8 x i32> undef to <8 x i16>
166 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %F1 = trunc <16 x i16> undef to <16 x i8>
167 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %F2 = trunc <8 x i32> undef to <8 x i8>
168 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %F3 = trunc <4 x i64> undef to <4 x i8>
169 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %G = trunc <8 x i64> undef to <8 x i32>
170 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %G1 = trunc <16 x i32> undef to <16 x i16>
171 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %G2 = trunc <16 x i32> undef to <16 x i8>
172 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef
174 %Z = zext <8 x i1> %in to <8 x i32>
175 %S = sext <8 x i1> %in to <8 x i32>
177 %A1 = zext <16 x i8> undef to <16 x i16>
178 %A2 = sext <16 x i8> undef to <16 x i16>
179 %A = sext <8 x i16> undef to <8 x i32>
180 %B = zext <8 x i16> undef to <8 x i32>
181 %C = sext <4 x i32> undef to <4 x i64>
183 %C.v8i8.z = zext <8 x i8> undef to <8 x i32>
184 %C.v8i8.s = sext <8 x i8> undef to <8 x i32>
185 %C.v4i16.z = zext <4 x i16> undef to <4 x i64>
186 %C.v4i16.s = sext <4 x i16> undef to <4 x i64>
188 %C.v4i8.z = zext <4 x i8> undef to <4 x i64>
189 %C.v4i8.s = sext <4 x i8> undef to <4 x i64>
191 %D = zext <4 x i32> undef to <4 x i64>
193 %D1 = zext <8 x i32> undef to <8 x i64>
195 %D2 = sext <8 x i32> undef to <8 x i64>
197 %D3 = zext <16 x i16> undef to <16 x i32>
198 %D4 = zext <16 x i8> undef to <16 x i32>
199 %D5 = zext <16 x i1> undef to <16 x i32>
201 %E = trunc <4 x i64> undef to <4 x i32>
202 %F = trunc <8 x i32> undef to <8 x i16>
203 %F1 = trunc <16 x i16> undef to <16 x i8>
204 %F2 = trunc <8 x i32> undef to <8 x i8>
205 %F3 = trunc <4 x i64> undef to <4 x i8>
207 %G = trunc <8 x i64> undef to <8 x i32>
208 %G1 = trunc <16 x i32> undef to <16 x i16>
209 %G2 = trunc <16 x i32> undef to <16 x i8>
213 define i32 @masks8(<8 x i1> %in) {
214 ; ALL-LABEL: 'masks8'
215 ; ALL-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %Z = zext <8 x i1> %in to <8 x i32>
216 ; ALL-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %S = sext <8 x i1> %in to <8 x i32>
217 ; ALL-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret i32 undef
219 ; ALL-SIZE-LABEL: 'masks8'
220 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %Z = zext <8 x i1> %in to <8 x i32>
221 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %S = sext <8 x i1> %in to <8 x i32>
222 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef
224 %Z = zext <8 x i1> %in to <8 x i32>
225 %S = sext <8 x i1> %in to <8 x i32>
229 define i32 @masks4(<4 x i1> %in) {
230 ; ALL-LABEL: 'masks4'
231 ; ALL-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %Z = zext <4 x i1> %in to <4 x i64>
232 ; ALL-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %S = sext <4 x i1> %in to <4 x i64>
233 ; ALL-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret i32 undef
235 ; ALL-SIZE-LABEL: 'masks4'
236 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %Z = zext <4 x i1> %in to <4 x i64>
237 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %S = sext <4 x i1> %in to <4 x i64>
238 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef
240 %Z = zext <4 x i1> %in to <4 x i64>
241 %S = sext <4 x i1> %in to <4 x i64>
245 define void @sitofp4(<4 x i1> %a, <4 x i8> %b, <4 x i16> %c, <4 x i32> %d) {
246 ; FAST-LABEL: 'sitofp4'
247 ; FAST-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %A1 = sitofp <4 x i1> %a to <4 x float>
248 ; FAST-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %A2 = sitofp <4 x i1> %a to <4 x double>
249 ; FAST-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %B1 = sitofp <4 x i8> %b to <4 x float>
250 ; FAST-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %B2 = sitofp <4 x i8> %b to <4 x double>
251 ; FAST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %C1 = sitofp <4 x i16> %c to <4 x float>
252 ; FAST-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %C2 = sitofp <4 x i16> %c to <4 x double>
253 ; FAST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %D1 = sitofp <4 x i32> %d to <4 x float>
254 ; FAST-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %D2 = sitofp <4 x i32> %d to <4 x double>
255 ; FAST-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
257 ; SLOW-LABEL: 'sitofp4'
258 ; SLOW-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %A1 = sitofp <4 x i1> %a to <4 x float>
259 ; SLOW-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %A2 = sitofp <4 x i1> %a to <4 x double>
260 ; SLOW-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %B1 = sitofp <4 x i8> %b to <4 x float>
261 ; SLOW-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %B2 = sitofp <4 x i8> %b to <4 x double>
262 ; SLOW-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %C1 = sitofp <4 x i16> %c to <4 x float>
263 ; SLOW-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %C2 = sitofp <4 x i16> %c to <4 x double>
264 ; SLOW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %D1 = sitofp <4 x i32> %d to <4 x float>
265 ; SLOW-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %D2 = sitofp <4 x i32> %d to <4 x double>
266 ; SLOW-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
268 ; FAST-SIZE-LABEL: 'sitofp4'
269 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %A1 = sitofp <4 x i1> %a to <4 x float>
270 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %A2 = sitofp <4 x i1> %a to <4 x double>
271 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %B1 = sitofp <4 x i8> %b to <4 x float>
272 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %B2 = sitofp <4 x i8> %b to <4 x double>
273 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %C1 = sitofp <4 x i16> %c to <4 x float>
274 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %C2 = sitofp <4 x i16> %c to <4 x double>
275 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %D1 = sitofp <4 x i32> %d to <4 x float>
276 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %D2 = sitofp <4 x i32> %d to <4 x double>
277 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void
279 ; SLOW-SIZE-LABEL: 'sitofp4'
280 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %A1 = sitofp <4 x i1> %a to <4 x float>
281 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %A2 = sitofp <4 x i1> %a to <4 x double>
282 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %B1 = sitofp <4 x i8> %b to <4 x float>
283 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %B2 = sitofp <4 x i8> %b to <4 x double>
284 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %C1 = sitofp <4 x i16> %c to <4 x float>
285 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %C2 = sitofp <4 x i16> %c to <4 x double>
286 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %D1 = sitofp <4 x i32> %d to <4 x float>
287 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %D2 = sitofp <4 x i32> %d to <4 x double>
288 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void
290 %A1 = sitofp <4 x i1> %a to <4 x float>
291 %A2 = sitofp <4 x i1> %a to <4 x double>
292 %B1 = sitofp <4 x i8> %b to <4 x float>
293 %B2 = sitofp <4 x i8> %b to <4 x double>
294 %C1 = sitofp <4 x i16> %c to <4 x float>
295 %C2 = sitofp <4 x i16> %c to <4 x double>
296 %D1 = sitofp <4 x i32> %d to <4 x float>
297 %D2 = sitofp <4 x i32> %d to <4 x double>
301 define void @sitofp8(<8 x i1> %a, <8 x i8> %b, <8 x i16> %c, <8 x i32> %d) {
302 ; FAST-LABEL: 'sitofp8'
303 ; FAST-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %A1 = sitofp <8 x i1> %a to <8 x float>
304 ; FAST-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %B1 = sitofp <8 x i8> %b to <8 x float>
305 ; FAST-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %C1 = sitofp <8 x i16> %c to <8 x float>
306 ; FAST-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %D1 = sitofp <8 x i32> %d to <8 x float>
307 ; FAST-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
309 ; SLOW-LABEL: 'sitofp8'
310 ; SLOW-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %A1 = sitofp <8 x i1> %a to <8 x float>
311 ; SLOW-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %B1 = sitofp <8 x i8> %b to <8 x float>
312 ; SLOW-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %C1 = sitofp <8 x i16> %c to <8 x float>
313 ; SLOW-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %D1 = sitofp <8 x i32> %d to <8 x float>
314 ; SLOW-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
316 ; FAST-SIZE-LABEL: 'sitofp8'
317 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %A1 = sitofp <8 x i1> %a to <8 x float>
318 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %B1 = sitofp <8 x i8> %b to <8 x float>
319 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %C1 = sitofp <8 x i16> %c to <8 x float>
320 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %D1 = sitofp <8 x i32> %d to <8 x float>
321 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void
323 ; SLOW-SIZE-LABEL: 'sitofp8'
324 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %A1 = sitofp <8 x i1> %a to <8 x float>
325 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %B1 = sitofp <8 x i8> %b to <8 x float>
326 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %C1 = sitofp <8 x i16> %c to <8 x float>
327 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %D1 = sitofp <8 x i32> %d to <8 x float>
328 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void
330 %A1 = sitofp <8 x i1> %a to <8 x float>
331 %B1 = sitofp <8 x i8> %b to <8 x float>
332 %C1 = sitofp <8 x i16> %c to <8 x float>
333 %D1 = sitofp <8 x i32> %d to <8 x float>
337 define void @uitofp4(<4 x i1> %a, <4 x i8> %b, <4 x i16> %c, <4 x i32> %d) {
338 ; FAST-LABEL: 'uitofp4'
339 ; FAST-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %A1 = uitofp <4 x i1> %a to <4 x float>
340 ; FAST-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %A2 = uitofp <4 x i1> %a to <4 x double>
341 ; FAST-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %B1 = uitofp <4 x i8> %b to <4 x float>
342 ; FAST-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %B2 = uitofp <4 x i8> %b to <4 x double>
343 ; FAST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %C1 = uitofp <4 x i16> %c to <4 x float>
344 ; FAST-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %C2 = uitofp <4 x i16> %c to <4 x double>
345 ; FAST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %D1 = uitofp <4 x i32> %d to <4 x float>
346 ; FAST-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %D2 = uitofp <4 x i32> %d to <4 x double>
347 ; FAST-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
349 ; SLOW-LABEL: 'uitofp4'
350 ; SLOW-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %A1 = uitofp <4 x i1> %a to <4 x float>
351 ; SLOW-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %A2 = uitofp <4 x i1> %a to <4 x double>
352 ; SLOW-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %B1 = uitofp <4 x i8> %b to <4 x float>
353 ; SLOW-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %B2 = uitofp <4 x i8> %b to <4 x double>
354 ; SLOW-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %C1 = uitofp <4 x i16> %c to <4 x float>
355 ; SLOW-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %C2 = uitofp <4 x i16> %c to <4 x double>
356 ; SLOW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %D1 = uitofp <4 x i32> %d to <4 x float>
357 ; SLOW-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %D2 = uitofp <4 x i32> %d to <4 x double>
358 ; SLOW-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
360 ; FAST-SIZE-LABEL: 'uitofp4'
361 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %A1 = uitofp <4 x i1> %a to <4 x float>
362 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %A2 = uitofp <4 x i1> %a to <4 x double>
363 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %B1 = uitofp <4 x i8> %b to <4 x float>
364 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %B2 = uitofp <4 x i8> %b to <4 x double>
365 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %C1 = uitofp <4 x i16> %c to <4 x float>
366 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %C2 = uitofp <4 x i16> %c to <4 x double>
367 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %D1 = uitofp <4 x i32> %d to <4 x float>
368 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %D2 = uitofp <4 x i32> %d to <4 x double>
369 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void
371 ; SLOW-SIZE-LABEL: 'uitofp4'
372 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %A1 = uitofp <4 x i1> %a to <4 x float>
373 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %A2 = uitofp <4 x i1> %a to <4 x double>
374 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %B1 = uitofp <4 x i8> %b to <4 x float>
375 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %B2 = uitofp <4 x i8> %b to <4 x double>
376 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %C1 = uitofp <4 x i16> %c to <4 x float>
377 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %C2 = uitofp <4 x i16> %c to <4 x double>
378 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %D1 = uitofp <4 x i32> %d to <4 x float>
379 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %D2 = uitofp <4 x i32> %d to <4 x double>
380 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void
382 %A1 = uitofp <4 x i1> %a to <4 x float>
383 %A2 = uitofp <4 x i1> %a to <4 x double>
384 %B1 = uitofp <4 x i8> %b to <4 x float>
385 %B2 = uitofp <4 x i8> %b to <4 x double>
386 %C1 = uitofp <4 x i16> %c to <4 x float>
387 %C2 = uitofp <4 x i16> %c to <4 x double>
388 %D1 = uitofp <4 x i32> %d to <4 x float>
389 %D2 = uitofp <4 x i32> %d to <4 x double>
393 define void @uitofp8(<8 x i1> %a, <8 x i8> %b, <8 x i16> %c, <8 x i32> %d) {
394 ; FAST-LABEL: 'uitofp8'
395 ; FAST-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %A1 = uitofp <8 x i1> %a to <8 x float>
396 ; FAST-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %B1 = uitofp <8 x i8> %b to <8 x float>
397 ; FAST-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %C1 = uitofp <8 x i16> %c to <8 x float>
398 ; FAST-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %D1 = uitofp <8 x i32> %d to <8 x float>
399 ; FAST-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
401 ; SLOW-LABEL: 'uitofp8'
402 ; SLOW-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %A1 = uitofp <8 x i1> %a to <8 x float>
403 ; SLOW-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %B1 = uitofp <8 x i8> %b to <8 x float>
404 ; SLOW-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %C1 = uitofp <8 x i16> %c to <8 x float>
405 ; SLOW-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %D1 = uitofp <8 x i32> %d to <8 x float>
406 ; SLOW-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
408 ; FAST-SIZE-LABEL: 'uitofp8'
409 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %A1 = uitofp <8 x i1> %a to <8 x float>
410 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %B1 = uitofp <8 x i8> %b to <8 x float>
411 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %C1 = uitofp <8 x i16> %c to <8 x float>
412 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %D1 = uitofp <8 x i32> %d to <8 x float>
413 ; FAST-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void
415 ; SLOW-SIZE-LABEL: 'uitofp8'
416 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %A1 = uitofp <8 x i1> %a to <8 x float>
417 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %B1 = uitofp <8 x i8> %b to <8 x float>
418 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %C1 = uitofp <8 x i16> %c to <8 x float>
419 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %D1 = uitofp <8 x i32> %d to <8 x float>
420 ; SLOW-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void
422 %A1 = uitofp <8 x i1> %a to <8 x float>
423 %B1 = uitofp <8 x i8> %b to <8 x float>
424 %C1 = uitofp <8 x i16> %c to <8 x float>
425 %D1 = uitofp <8 x i32> %d to <8 x float>
429 define void @fp_conv(<8 x float> %a, <16 x float>%b, <4 x float> %c) {
430 ; ALL-LABEL: 'fp_conv'
431 ; ALL-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %A1 = fpext <4 x float> %c to <4 x double>
432 ; ALL-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %A2 = fpext <8 x float> %a to <8 x double>
433 ; ALL-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %A3 = fptrunc <4 x double> undef to <4 x float>
434 ; ALL-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %A4 = fptrunc <8 x double> undef to <8 x float>
435 ; ALL-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
437 ; ALL-SIZE-LABEL: 'fp_conv'
438 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %A1 = fpext <4 x float> %c to <4 x double>
439 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %A2 = fpext <8 x float> %a to <8 x double>
440 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %A3 = fptrunc <4 x double> undef to <4 x float>
441 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %A4 = fptrunc <8 x double> undef to <8 x float>
442 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void
444 %A1 = fpext <4 x float> %c to <4 x double>
445 %A2 = fpext <8 x float> %a to <8 x double>
446 %A3 = fptrunc <4 x double> undef to <4 x float>
447 %A4 = fptrunc <8 x double> undef to <8 x float>