<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/91054>91054</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
SLP would be more essential after LoopUnroll
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
edemilkhovsky
</td>
</tr>
</table>
<pre>
In PassBuilder::addVectorPasses() the SLP runs before LoopUnroll.
Actually the LoopUnroll produces many lines of scalar code and SLP should run after to glue scalar ops together.
And one more things that I saw in this context. I tried to run SLP again after loop unroll and
if I have a code inside loop like A[i*2] + A[i*2+1} - SLP makes load <2 x i8> and then after unrolling + SLP the code sequence is less optimal.
So the scheme SLP - LoopUnroll - SLP is also suboptimal in some cases.
As far as I see invoking Unroll then SLP gives best results.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxUU82O8ygQfBp8aSWysZ2fgw_JZiNF-g6fNNq9t6Fts8GQpSEzefsVTqKZPSHR3VVFVYPMZnREnWiPoj0VmOLkQ0eaZmOvk7_z9VH0Xj-6i4PfyHxMxmoKoj6I-oBa_00q-pArxELuhNxDnAg-fv2GkBxDT4MPBL-8v_3lgrd2LcqTKA8HFRNa-1i6v6twC14nRQwzugdY44jBD8AKLQZQXhOg0ws-Tz5ZnWkAh0gBoofRJno3-xtD9CPFicKL9cXtNHhHMGdlcTJuZIgTRrgA4ycYly8ZlHeRvuIaLhCDIZ3xM1nmxhHNm9Z6f4P0lI9OPznMABeY8E6AT9XGsdH0bLbmSnAQ7dEIeZCiPYGQxx8X8liJ7QlWC9WMV2KwHjWI-g8JX2B2ov5zsSFO9FbxFGDcuGDlwezsQs30byKnCAyDJWbwt2hmfEfx4ZdWVhPNz-RWPxN5qjAMaNkDp_41nX1iPxMoZOJ3rAwDBkDOXlJ-9d1fs6gX2CI4443mTnk7OEIgTjby_yIqdFfrfb3HgrpqWzW7qtnuZDF1DVV6owe115VUA8qq6bc19i2pdle3m6EwnSxlU7ZlU-7lRlbrspQ71fRt09YbVLoRTUkzGru29j6vfRgLw5yo21dl2xQWe7K8fAcpHX3CUhQyp1SELs-s-jSyaEprOPI3SjTRUpff9rnsZf9aMGImFw3aV1Df1hYp2G6K8cb5O8mzkOfRxCn1a-VnIc8Z-nWsbsH_QyoKeV4EsZDnRfB_AQAA___v4Dzz">