<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/62586>62586</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
(a > b) | (a < b) is not simplified only for the case b=0
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
k-arrows
</td>
</tr>
</table>
<pre>
https://godbolt.org/z/cbPj6zfjx
```c
int foo(int a)
{
return (a > 0) | (a < 0);
}
int bar(int a)
{
return (a != 0);
}
```
```llvm
foo(int): # @foo(int)
xor eax, eax
test edi, edi
setg al
shr edi, 31
or eax, edi
ret
bar(int): # @bar(int)
xor eax, eax
test edi, edi
setne al
ret
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUU92ymyAQfpr1hkkGQSVeeJGfet1XAF0jKZEMYJtznr4jGtuk50zbHcfFb9n99sNFeq_PA2IF-QHyUyLH0FtXfdtI5-wPnyjbvlV9CDcPfA-sBlafbausCVvrzsDqd2B1o75eivfucgd6Arpf3gWdn2b-1kMgnbXAdtNKAiuXfeIwLwghxGEY3UCA7SQB_oVQYCUBcXwgx4gAPzxyT79TToWVdP9BwVLgp89qPgR8qMqY79cZWkXFKnsCjBPI6BO8sk92ty56lHdgx-jmeEAfYqDVMdDq50SP4Tx5aV7wfik45_F0CS88K9FrPYdhBtZDWyT8xRaFT1n_pnCxT4V6DAN-oHDtdD3_pK14W_JSJlilxY5nXIhSJH2VZiwXJeYZdjndCVmWZSc7keaCsUy1baIrRhmnORU05wUvtkKoXIkMaSqlakQLGcWr1GY7_eNpzBPt_YhVwfJdkRip0PjHfXHVtGmjxrOHjBrtg_-VFnQwWK3DrP4Y5ohoTwYbiNfXm9GdxpbYwbyRzjoSeiSN9EgU8BNNRmde76IO_ai2jb0Cq-NIzm5zc_aCTQBWx949sDq2_zMAAP__Vx4Kfg">