<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/77748>77748</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Miscompile of dav1d on ppc64le
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:PowerPC,
miscompilation
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
nikic
</td>
</tr>
</table>
<pre>
The checkasm test of https://code.videolan.org/videolan/dav1d fails on ppc64le when built with `meson --build-type=plain`.
The issue bisects to 1a2e77cf9e11dbf56b5720c607313a566eebb16e, which presumably just exposes the issue.
Using opt-bisect-limit and debug-counter=instcombine-visit-count we can narrow this down to an InstCombine transform. However, I believe the transform itself is correct (it just converts some extractelement/insertelement into a shufflevector) and this just exposes an issue in the backend.
The before.ll and after.ll in https://gist.github.com/nikic/b4c015523bcd22ea159d183c0648deea are before and after the transform.
The llc output for these two files is before.s and after.s in https://gist.github.com/nikic/ea9909b8216726762c8f2f277abc8006. (I've run `llc` with `opt-bisect-limit=0` to mostly isolate isel only.)
The difference is in two vperms and corresponding constant pool shuffle indices.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUlM1yozgQx59GvnSZEsKAOXDIxuXaHLZqDrsPoI_GaCIkSt3Yk7ffAseTSeY0Fyh9df9a_79aE_lLROxF_ZeoTzu98JhyH_2rtzuT3Fv_74hgR7SvmiZgJIY0wMg8k6iehDoLdbbJYXH1DlPQsUj5ItT5MRTq7PS1dDBoHwhShHm2zSEg3EaMYBYfGG6eRxCNnJBShP1-nXV7fptRVKc5aB9FIwshT0I-3b8rlSdaEIwntEzACUqtsG3t0GFZOjPUjalbJW0j26qsdN00iMaUDQr1DLfR2xHmjLRM2oQ3-L4QA_6YEyEBP8J_Svof-XiBNPP-nnQf_OQZdHTg0CyXvU1LZMyiOvlIbNNkfMT91ZPn-xrcEKyOEHXO6QY8egKXbnGl1xFeIvHz_RR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