<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/146037>146037</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[VectorCombine] Generalise foldBitOpOfBitcasts into foldBitOpOfCastops
</td>
</tr>
<tr>
<th>Labels</th>
<td>
good first issue,
llvm::vectorcombine
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
RKSimon
</td>
</tr>
</table>
<pre>
foldBitOpOfBitcasts allows us to fold bitlogic(bitcast(x),bitcast(y)) -> bitcast(bitlogic(x,y)) if x and y are the same type and it doesn't cost anymore.
We can generalise this to work with other matching cast ops (trunc/sext/zext) - similar to how foldShuffleOfCastops works (although much simpler as there's no shuffle mask manipulation to do).
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxsUsGOozoQ_Jrm0koEDYRw4JDJvLzDO4z0Rto9GzDgHWMjdzNJ9utXeLLKHvZkqbqqu9pditmMTusGyhcoXxO1yuRD8_9_72b2Lml9f28Gb_sXI2_L2_BipFMsjMpaf2VcGcXjRsDWiPWj6YCO7RcL6HgDqoHOT-AegRp3kP-DT_gP8Q3o_JtlBryhcj3eUQWNMmlkNWuU-6IjbgR7r9kBVYKdZ0Hl7rMPeg_pCdLTd42dcjhqp4OyhrceJnq--vCBVyMTepl0wFlJNxk34uYI_cIIdJSwug7owvomQJef8alxh2xmY1XYGk3-Gj_gfVqHweq34axYNv02IXZRVia_jhPOazdt0sXqgIq3fYIGqhidR_7S46z4A2flzLJaJca7bUjvgep90jd5X-e1SnSTVWWWZlldZsnUVEVa10M9ENV51pcVFbk6FGlXDMMhb1WamIZSKtMDVekxozzbD21P5VC0aVtRV1ZHKFI9K2P31n7Oex_GxDCvusmKQ5pXiVWtthxDQjR63-NgAgtGEhABnYFo00J-gvz0qTvxofNza1ysl69JaLb6rl1HhiK1hoWf08SIjSH8FpXnh7J8xX-ft_tbEI17BPBRePx-sgbbTCILb4boAnQZjUxru-_8DHSJVr-e3RL8D91tB47rMNDlsfZnQ78CAAD__5zqCjQ">