<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/124099>124099</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
AMDGPU fails to fold out useless half of 64-bit or
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:AMDGPU,
missed-optimization
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
arsenm
</td>
</tr>
</table>
<pre>
In some tests I see this pattern appear:
```
t334: v2i32 = BUILD_VECTOR Constant:i32<0>, t258
t335: i64 = bitcast t334
t188: i64 = or # D:1 t342, t335
```
We should be able to do a 32-bit or and drop the operation on the 0 bits. The same applies for other identity value elements, like -1 with and. This is similar to 09583dec15c5100fd5f26f81a1b011bce3f9b21f, except it's a variable case (and for or, instead of add/sub)
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxUks-O4zYMxp9GvhAJJMrOOAcfspNNMUCLFsVueywki47VlS3DpNNOn76QJ-gfgYAAifjx-0g65nifiTrVfFLNtXKbjHnt3Mo0T5XP4b17m4HzRCDEwvAGTAQyRobFidA6g1sWcquyF6X3OOln6As8j1hbK3uBB0aLoOwVPn19-_762y-fX7_8-DO85pnFzaLsJVpU9lUr-1nhKwg27T8YsbYpkHiqd4SP0juWD_hHkpi2_W9KXkGhhauyFwNia9yhhfN_nUpffiXgMW8pgCdwPhFIhpDBgcWDj1JYbg4Q1ryAjAR5odVJzDPkeX_QRREf4ctIwG6i0pgUiWHIK2QZaYUYaJYo7_BwaSOgRBPNwkVVit8IDgb-iDKWQoUTGSIDxykmtxY9-ty0NlBvmr4xWg-hGfA0tMYZr43xPdnh7NEMBUh_9rQIRFH4wuDg4da4--odEyhsi5td2lrS48xCLkAewIWg8MabV3iuQmfD2Z5dRZ15sS8nq1FjNXbe1cb3hoJG73x9smSHlowddO0Cntoqdqix0QatMdoiHt3JeWvJ-ZdWo0Wrak2Ti-mY0mM65vVeReaNOoO1Pp-r5Dwl3hcT0bv-G81B2cvlh-t3P31VWEapEKfITOGQF4lT_GufR_lrrtXaFe7Bb3dWtU6Rhf-tJFESdR8sGFxMXNo75BQgbwIbUyJmGF0aSkdO9XMFqm1N3SiycNl3vCm83aOMmz_2eVJ4KwWe12FZ8-_Ui8Lb7osV3p7WHh3-HQAA___8Ew99">