<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/69464>69464</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
InstCombine generates "fabs" calls from "And" pattern that is not correct in OpenCL
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
rjodinchr
</td>
</tr>
</table>
<pre>
Since llvm/llvm-project@5c0da58 instcombine transform pattern masking the MSB with a call to fabs.
While this might be correct in C, it is not in OpenCL. Math operations are allowed to flush denormalized numbers to zero in OpenCL. Thus what should be just masking the MSB starts to change much more data.
This is an issue in libclc as those implementations are using this pattern and rely on the fact that only the MSB is masked. Using fabs instead breaks conformance on platforms where fabs flushes denormalized numbers to zero.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8k0Fv5DYMhX-NfCFq2LI9GR98yM5igAJd9LBb9ExLHEuJLA1EuoPk1xfyJGnaAnuxYRoi33v8hMx-iUSTGr6o4WuFm7iUp_yUrI_G5WpO9mX67qMhCOGvVelzef1yzemJjKi-GUxjcTiCjywmrbOPBJIx8iXlFa4oQjnCivzs4wLiCL59_wI3Lw4QDIYAkuCCM9eq-aqax_vzT-cDgTjPsPrFCcwEJuVMRsBHOCl9Ai_gGWLaK79fKZ5-q-EbioN0pYziU2TATIAhpBvZfVDY2IGlmPKKwb-ShbitM2Uuf18pp8_NfriN4eZQgF3agi0qnjaW_9lhwSx7C-MwLgTrZhysKRNYFPyXtR_FlGfACJ55ozIw-NkEA8ggLjGBX6-BVoryycXG94meP1LFaCFTeIEUdykXNAJS9KYYXj7UlRCRn8nW8MfepMS9L4zQwpwJnxlMimVjWDadIlwDSvku_inT_cieHvFP86srO3V27EasaGoP48OhO_bDULnp2HWmbR_wYIdxbNDS2JrLOIzzxeiuN1j5STe6a5v22PZt3w71gx1w7tqDni9jO1Cv-oZW9KEuDNYpL9We4HQY-0NfBZwp8E6y1pFu93iV1gXsPO3cztvCqm-CZ-F_uoiXQNOvkeX0RvBCsSBEDErr4l1pvdPKcMlpLdXHaEvxfRd77G88fiL1jlK15TA5kSur7lHps9LnxYvb5tqk9zv136ulz7t-Vvq8-_s7AAD__23TQe4">