<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/136430>136430</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[InstCombine] ninf should not be propagated
</td>
</tr>
<tr>
<th>Labels</th>
<td>
miscompilation,
llvm:instcombine,
floating-point
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
dtcxzyw
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
dtcxzyw
</td>
</tr>
</table>
<pre>
Reproducer: https://alive2.llvm.org/ce/z/cmneUX
```
define half @test_fcmp_select_maxnum(half %x) {
#0:
%cmp2 = fcmp ogt half %x, 0x5bf8
%sel2 = select nnan ninf nsz i1 %cmp2, half %x, half 0x5bf8
ret half %sel2
}
=>
define half @test_fcmp_select_maxnum(half %x) {
#0:
%sel2 = fmax ninf nsz half %x, 0x5bf8
ret half %sel2
}
Transformation doesn't verify!
ERROR: Target is more poisonous than source
Example:
half %x = #xfc00 (-oo)
Source:
i1 %cmp2 = #x0 (0)
half %sel2 = #x5bf8 (255)
Target:
half %sel2 = poison
Source value: #x5bf8 (255)
Target value: poison
Summary:
0 correct transformations
1 incorrect transformations
0 failed-to-prove transformations
0 Alive2 errors
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJysVMtu6zYQ_RpqQzigRg9LCy1842ugqwJpCnQXUNTQZsGHQFKuk68vKCmKDTRdXUDQa845c4bkDA9BnS1iR6ofBGCI4vbx_g8BINUx41O8ON-tP7PeDe_dC47eDZNAT4oDvcQ4BlIcCJwInLhWV4Qnra_myfkzgZNAAqeP9GIs_vkXYQdSs_VihwGlskgvXEtKShYxxDcpzPgWUKOIb4bf7GQINAsCqhuBlpL9j6QDBUuJ2YGmiDAjUFIcaeJTd470jvNM2a3qZfMJDqgX8JKHWssttcpKasMHVfmnYGI-yMwfd1oev_Ik0eRrf0z34kiKn7-uxHvT0vDbl9vvyvzW2qvnNkjnDY_KWTo4DJbAPtIreiXfCeQJyg4_X15-f0l7_Mr9GSNVgRrnkY5OBWfdFGi8cEuDm7zAlXLjZtS4eN6MzaYJFDcpGKMEmp1zBNqF8sdCnxlfC79RZjxb0PfVbIBUb8JAVW2ai-FHFxtpsb9lpleup5T_v9XW2jfQxk4CkzHcv38eQkaF8z4dp_iwwiFFc6rs_4Qpo5IrjcMuut3o3RW_QR3mDqPovfPhvpuyoSuGtmh5hl2-LytW79umzi6drHohG1b3KIe2lHVbl8Aa2VRQDk3R1pnqgEHFyrzNC1ZD_dQMuci5aIaelQh7QUqGhiu99XWmQpiwy4u6LFimeY86rPPDqCCcGZWeXacxAs8EIDFJcVA2ROFMryxuIakdj8qed6NTNq6Dx3eJseuncyAl0yrE8JU9qqjnefWbDfF5lauOS0uEi5v0QK2LtEc6ejfyM484ZJPX3eO0Oqt4mfon4QyB0-xweaQN-BtFJHCaCw0ETmut1w7-DQAA__-NlZZX">