<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/113597>113597</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[SPIRV][HLSL] Handle lowering of vectors larger than 4 when targeting spirv
</td>
</tr>
<tr>
<th>Labels</th>
<td>
HLSL,
backend:SPIR-V
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
joaosaffran
</td>
</tr>
</table>
<pre>
In https://github.com/llvm/llvm-project/pull/109331 we generate vectors with size larger than 4. This is an issue when targeting SPIR-V, which native vector size is limited to 4. This will be a recurrent issue when adding Matrix support. There needs to be some pass that can break up vectors and vector operations to fit into the max-4-compponent constraint. Currently, in https://github.com/llvm/llvm-project/pull/109331, the generated code handles such constraints in `CGBuiltin.cpp` when expanding the clang builtin for initial IR codegen.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykkzFv4zgQhX8N1QwsSJRlnwoViQNfAuSAQxKkH1FjcRKaJEjKTu7XHyjD2ex2iy0ENeT35s17xBh5skS9aG9Fe1fgnLQL_ZtDF_FwCGiLwY2f_YMFnZKPorkRci_kfuKk56FU7ijk3pjT9bfywb2RSkLu_WyMkPu66pqmhjPBRJYCJoITqeRChDMnDZH_IzAYJgqQNFpYl_CiOQJHQAsc40xw1mQh5UOJ7QTP_z48rV6F3MFZs9JgMfHpyr0QOYLhIycaIbkv5pmNgYEAIZCaQyCbvivgOGb8P5gCf0CcvXchlQAvmgKBJRpjpg0E0R0JPMaYZ06g0MIQCN9h9l_20I7XkZzPztnZ5f6BE7BNDpImOOLHar1S7ui9s3ke5WxMAdlm5d1lSPOZzfKfppAhWfOaxAjKjQQa7WgoQpyV_iYfs6DYVLu_b2c2iW2pvBeb6rIr-vBol3VlojJoJxgu5-DgArDlxGjg4WkRmciWxdg3Y9d0WFBfb2W37aRs2kL3m2asDlJtVNdshw4rom5Yt4emrbZY1xsquJeVXNf527ZV05bU1dWmaxElYvNX24h1RUdkU2b7pQtTscTa13XTdtvC4EAmLi2X8v7x-VFIKeROSDmgeic7iubmWiqZH0Lolz0O8xTFujIcU_yBTpzM8mTylVfR3on2doG2d3C_7BKMO1PIy3GHrz78VPJfKx09h1MxB9P_dsSL05hDvpg99fL_AAAA___JzUqr">