<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/120775>120775</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[VectorCombine] Handle shuffle of selects
</td>
</tr>
<tr>
<th>Labels</th>
<td>
missed-optimization,
llvm:transforms
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
RKSimon
</td>
</tr>
</table>
<pre>
VectorCombine can't currently fold `shuffle(select(c0,t0,f0), select(c1,t1,f1)) -> select(shuffle(c0,c1),shuffle(t0,t1),shuffle(f0,f1))` - although foldShuffleToIdentity can fold some very basic cases.
This is trickier than foldShuffleOfBinops etc. as the default increase in instruction count will likely prevent basic fold from succeeding (from a cost:benefit), so we will need to just handle cases where at least one of the folded inner shuffles gets simplified away.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxkU8GO6zYM_Br5QiSQ5Xj9fPAhL9ugRQ8F-ha9yzIVc1eWApFOkH59YTtFWryLDHCo0cxgbJnpEhE7VX9X9XthZxlT7v78_QdNKRZ9Gh7dX-gk5VOaeooIzkZlGgE354xRwgN8CgOoN83j7H1AZb4xBnSizDenlTnJcnitTKvMCV5YuWDL4csVa2Gnql9eCy--lcZtW6fXeCWWn8Ze_4dTvWnYgQ0ypvkyrlp_bJsf6bcBo5A8Fk-bC04Twg3zA3rL5MBZRt4rfVT6-DESAzFIJvdFmEHG57Un4R_-O8V0ZUBxe7AMMiIM6O0cBCi6jJYRKAJFljw7oRTBpTkK3CkECPSF4QHXjDeM8lSwyvI5TcCzc4gDxQssJpeRBZdYVHXsMaIn-TfiBHfcOCPiAJLgc2aB0cYh4GYK7iNmBCsQ0LJAigjJr5KXJ3EAihEzPGNluKAwME3XQJ5wAHu3j30xdNXQVq0tsCub6tCUh0q3xdg1dWvQmrotq6HFypRvxh80utb7RmusC-qMNofSGF02utbt3vd26NHrujpY0w69OmicLIV9CLdpn_KlIOYZu9LopqmLYHsMvNbWmImYcdilq9BEf9slWGWMMidlzHJdVUfJNrJPeeIFqd-L3C3Irp8vrA46EAu_nhKSsP4T_-u-qt_h1y3DZyxLZFtfuZhz6EaRK6vqqMxZmfOFZJz7vUuTMudVx_bZXXP6XDt-Xj2xMuenrVtn_gkAAP__ajYufg">