<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/72911>72911</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Miscompilation - results change at -O1
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ericastor
</td>
</tr>
</table>
<pre>
Demonstration at https://godbolt.org/z/jx3dvTcY7
LLVM IR that seems to miscompile:
```
define i64 @__sample__main(ptr %input_ptrs, ptr %output_ptrs, ptr %tmp_buffer, ptr %events, ptr %user_data, ptr %runtime, i64 %continuation_point) {
entry:
%0 = alloca i256, align 16
br label %start
start: ; preds = %entry
%1 = load ptr, ptr %input_ptrs, align 8
%x2.i.i = load i8, ptr %1, align 1
%2 = zext i8 %x2.i.i to i256
%3 = icmp uge i8 %x2.i.i, -127
%4 = shl i256 1, %2
%5 = select i1 %3, i256 0, i256 %4
%6 = and i256 %5, 680564733841876926926749214863536422911
store i256 %6, ptr %0, align 16
%7 = load ptr, ptr %output_ptrs, align 8
%x6.i.i = load i256, ptr %0, align 16
%8 = trunc i256 %x6.i.i to i64
%9 = and i64 %8, 8589934591
store i64 %9, ptr %7, align 8
ret i64 0
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVF2L4zYU_TXyi0iQJflDD36YaQgUdimUUuhTkO2bRIssGel6Oru_vkjOJp4hhTaYJL4659wv3atjNBcH0JHqlVSHQi949aGDYAYd0Yei9-P37gCTdxGDRuMd1UiviHMk4oXwI-HHix97b3Hvw4Xw4w_Cj9_exfj2x_BXQ9iBsJf1-8uXP7_SX3-neNVII8AUKXo6mTj4aTYWkt4Kr9ntya8jnI0DampJiWSnU9TTbOF0mrRxhLczBkp4Zdy84GnGEAn_hd6MfsEnVpzmU7-czxA2RngDh1vUEiGcRo16YwuLQzNBsuRweDV4h8YtuTKn2RuHhCtKmtc1dnAYvt8To4nBKBEHqq31g6aGV3VS09ZcHC3rn7g-UKt7sIkQUQfcFnI1iBf6Pz5EvNI5wBiz95RvjuwRVpkPrNdjSnaT88fCroG2G-I735u9ebBNuyGXm-Q2HJ7hP-AdqWk3IujXijyQIiPNMM10ucAHdJLelbzZoGVGx6vNMjR7T-42kGqFgIUBqSmzj9zPRGD3f0lsw6rXprnxflolaN2yqpaNEK0s26ZWPD2NVLyUbS0qUUvOVXnPPE0U3BXqTZ3Ys0tAeNX8W1c-3eyPbUklqj915b_5azMDw-KGe5w3qdSbWj48qEdJ1lHIfW-rVikhK_U56RWjNjE0T-5TAMzQ2-iT5vB0JRRjJ0YllC6gKxvGqpJJoYprV4vmrPqhbc99PcpmkFDxc8mEavTQVHAuTMcZF2XJGWeMiWrfsJ737aBqLVXfSk0kg0kbu7f2bUorrTAxLtA1qZFFHsqYtyXnDv6m-ZBwnpZn6BJn1y-XSCSzJmJ8qKBBC93Xn9tuXaU7GiAuFiMdrtpdIO3W3W9lsQTbfdqxBq9Lvx_8RPgxid5-dnPw32BAwo85lEj4MYf6TwAAAP__Ch-gPQ">