<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/143527>143527</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
The handling of poison in memory is incoherent
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
RalfJung
</td>
</tr>
</table>
<pre>
LLVM currently contradicts itself in terms of how poison behaves when stored in / loaded from memory.
- On the one hand, load widening passes will basically assume that there is no poison in memory. Combining two `i32` loads to an `i64` load is wrong if there is poison since the entire `i64` will be poison if just one of the two `i32` was poison.
- On the other hand, reg2mem assumes that all SSA values can be stored in memory, including poison. Also, the docs for dead_on_unwind talk about this behaving "as if" the data behind a pointer was overwritten with poison, clearly presupposing that there could be poison in memory.
These contradictions will have to be resolved one way or the other for Alive to be able to properly deal with poison and loads/stores, as well as for frontends to know what exactly they can and cannot do in the LLVM IR they generate. Also see https://github.com/llvm/llvm-project/pull/141339.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUVE2v2zYQ_DXUZRFDpiw9-KCDm8JAixQFkqDXYCWuJCYUV-BSVv3vC1LP7zntqScJ_JidmZ0litjRE7Wq_kXVvxa4xolD-xnd8Pvqx6Jjc28_ffrrD-jXEMhHd4eefQxobB8FbBRyA1gPkcIswANMvMHCVthDRxPeSGCbyINEDmTSUaWv4BgNGRgCzzDTzOF-UOVFlZcP8KeHOBGwJ5jQG6U_5tOwWUPe-hEWFEmo1jnoUGyPzt0BRdaZIE4Y0_1AYAU8P7hY_6gDH3nubEaKG4NqSltp1ZS5ikBkQJ9Xm9NjNUFtgf0IdngHf0UW63vKlMlHG-jp7k6R3jgM8H2VmKVxBvoXgw0fqIefrEgl38wINOqZ5lfBsitG5-DLlwvc0K0k0GNy_8nzXXu6bn3vVpN93CvBxQmnnVTKcC8wcABDaL6x_7b6zXoDEd0PwI7XZK6VvbUJRGmNAnZQWu8AGDHtpkuYSvhIIQvjG4Ut2BjJw2bj9Fo_Ve4dYXB3WALJuiwsuTnvnex5debZSP9zaL5OJPQUTMv-NR8pgKmlHUEgYXcjk-3f8A4cntxNmi_Ovp3GzuXfJfBCiZshdM-8Ab3ZI6P0NRstSQoKbORc-ibIIbCP5Pdc_fC8wZZk0d_Yp1mKE91zsxJYj95zBMN5niaCPHi_fd5PjeQpYKS9XyBEMMW4iKouSl-Vvo42Tmt36HlW-urc7fH5sAT-Tn1U-rqszil9PZ6OVXU-FKatzLk6Y0Ht8eV0rpuyOdbF1J46U1bGnJsOK6JKm440naoam7o_DualsK0udV02x_JYlVVVHzp6qav-rGtNHb40Wp1KmtG6QyJw4DAWVmSl9niqav1SOOzISX50tPa0Qd5VWqc3KLSZdbeOok6lsxLlHSba6Kj9Ou1vg0s54eE_sUjTaX3PKTw-Fmtw7f_2KlOS7FbmfGv1PwEAAP__90_IJQ">