<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/99797>99797</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Wrong simplification by GVN
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
bonjune
</td>
</tr>
</table>
<pre>
alive2 report: https://alive2.llvm.org/ce/z/Q7wtE9
```ll
----------------------------------------
define i1 @fun0(i8 %val0, i8 %val1) {
#0:
%val2 = and i8 %val0, 1
%val3 = icmp eq i8 %val2, 0
%val4 = add i8 %val1, %val2
%val5 = icmp eq i8 %val1, %val4
%val6 = or i1 %val3, %val5
ret i1 %val6
}
=>
define i1 @fun0(i8 %val0, i8 %val1) {
#0:
%val2 = and i8 %val0, 1
%val4 = add i8 %val1, %val2
%val5 = icmp eq i8 %val1, %val4
ret i1 %val5
}
Transformation doesn't verify!
ERROR: Target's return value is more undefined
Example:
i8 %val0 = #x00 (0)
i8 %val1 = undef
Source:
i8 %val2 = #x00 (0)
i1 %val3 = #x1 (1)
i8 %val4 = #x00 (0) [based on undef value]
i1 %val5 = #x1 (1) [based on undef value]
i1 %val6 = #x1 (1)
Target:
i8 %val2 = #x00 (0)
i8 %val4 = #x01 (1)
i1 %val5 = #x0 (0)
Source value: #x1 (1)
Target value: #x0 (0)
Summary:
0 correct transformations
1 incorrect transformations
0 failed-to-prove transformations
0 Alive2 errors
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzElU9zmzoUxT_NZaOxR1z-mQULJw5v9968NNOuBRK2MgK5knDifvoOiNjGcabpotNMxjbwu-eecxGIWSu3nRAFJHeQbALWu502RaW7574TQaX5sWBKHgQSI_baOIjWZOfc3kK0BiwBS395qdShXWqzBSxrAVj-ACz_z17cQw50A3Q9fabU_yvlTyw--edpLhrZCSJDAjFt-o4CruSKACYHpijgPTkdhYA5gexu6osRHRyPB2RCkEC0IazjZK4RzrFoxGTd7on4fkZxQOkcjb0i5zMf96eKGZzc1r0oiOcF6VigzZjfWzuzyRtrhDsD6RQ_20w_og1ED39xmH9qQrPUyVXqJ8M622jTMid1R7gWtgPMHDkII5sjYHi5Rh8eH_97HNb5EzNb4QAzO8j3piMHpnpBpCWtNoL0nR8hn1W_snavxGk-52mMYQCjV0oJ4IoC5ldIOCKj7KXkF92b-oYifqwYztbugAxnVuH7nvFNkRySu4pZwYnuvCGfHZLNVYfkVofPl6cfGZzunL8FvxP9RrDr7O-9X4n4iU-eo_Utf97ZHLlSmbT6tmXmePHAUFJrY0TtiJstTPsGhER2v0AoaZhUgi-cXuyNPoiPwbV_fwtjtLFXr-GAFxHPo5wFoggzDJMozZEGu4LHSRUmIU35Ko94jimPkjivU1bRkK9oFsgCKcY0w5DGMVK6bGiONa1SWlUNo1UDMRUtk-q0MwTS2l4UeZ7lWaBYJZQdtx3ETryQ8SIgDruQKYaaRdVvLcRUSevsWcVJp0TxzehuS6xs90o2svYPdnUk_3z9N-iNKuZ71Fa6XV8ta90CloPS9DWM7lnUDrAc-1vA0vs7FPgzAAD__w2N7Ug">