<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/113123>113123</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Wrong canonicalization of a range check idiom
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
bongjunj
</td>
</tr>
</table>
<pre>
https://github.com/llvm/llvm-project/blob/11dad2fa5138a50d60a5a34a2c7e074b976820e2/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp#L1511-L1527
Alive2 report: https://alive2.llvm.org/ce/z/2b7VR2
```llvm
----------------------------------------
define i1 @test_and_olt_fmf_propagation_union.2(float %x) {
#0:
%cmp1 = fcmp nnan ninf olt float %x, 0.000000
%cmp2 = fcmp nnan nsz ogt float %x, -0.000000
%#1 = select i1 %cmp2, i1 %cmp1, i1 %cmp2
%cond = and i1 %#1, %cmp2
ret i1 %cond
}
=>
define i1 @test_and_olt_fmf_propagation_union.2(float %x) {
#0:
%#1 = fabs nnan ninf nsz float %x
%#2 = fcmp nnan ninf nsz olt float %#1, 0.000000
ret i1 %#2
}
Transformation doesn't verify!
ERROR: Target is more poisonous than source
Example:
float %x = #xff800000 (-oo)
Source:
i1 %cmp1 = poison
i1 %cmp2 = #x0 (0)
i1 %#1 = #x0 (0)
i1 %cond = #x0 (0)
Target:
float %#1 = poison
i1 %#2 = poison
Source value: #x0 (0)
Target value: poison
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/eJy8VV2P6jYQ_TXmxQLZ44TAQx64l4tU6UpX2q7avqFJ7ARvEzuyHbq7v76KgZCw26-XRhFgPOd4zvHYg97r2iiVk_QLSfcL7MPJurywpn7pzcuisPItP4XQeSJ2BA4EDrUOp75YlbYlcGia8-1r2Tn7ospA4FA0tiBw4FyihAp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