<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63751>63751</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
(a >= b-1) & (a < b) is not simplified for the case b=0
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
k-arrows
</td>
</tr>
</table>
<pre>
This issue is similar to https://github.com/llvm/llvm-project/issues/62586.
https://godbolt.org/z/b5jYsnseT
```c
int foo(int a)
{
return (a >= -1) & (a < 0);
}
int bar(int a)
{
return (a == -1);
}
```
```asm
foo(int): # @foo(int)
xor eax, eax
cmp edi, -1
setge al
shr edi, 31
and eax, edi
ret
bar(int): # @bar(int)
xor eax, eax
cmp edi, -1
sete al
ret
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykU8tu2zAQ_JrVZWGDWup50CGJqi_IpUdSpC2mtGiQVJP26wtJtmqnKdqihAHSs5wdDbEjQjDHUesG8kfI20RMcXC--bIT3rvXkEinvjXPgwloQpg0moDBnIwVHqPDIcZzAP4A1AF1RxOHSe57dwLqrP163XZn7150H4G6pUkA6grKq2IPrAX28K6LU9LZuHf-CNR9B-pk_vI5jEE_r9ehYOuvX_-bMeLBOaBqPgmg-nKvfFwPiIhex8mPCFQJBP4JeIu7FKhGoOKKPiGbyfzxym8vh01GCv8vMu0m80HTq4tbjQ0U4bQim7GlyQMCcYSM3cGb-rzenF92Ld6AnpZtrfen81pQZi7s0nte0PGoEVHYd_jgb2n8ShOjutNR5p7ndVyB7c0uDv6wLgbvWH9n8LJ-5zPoOPv7xeD2odvjJ6rhqua1SHSTFlVVVqzI62RoOOUsLdOy1rxQZSao76tCcpX1VS2pqBPTECPOSlaxNMvSeq90VRJPdV6wquxVBhnTJ2Hsfs7FPOLJkoim4GWeJlZIbcMSRaJRv66ZA6I5mb5ZsiSnY4CMWRNi-Nklmmh1czvd8oPxljNiAo4uzik-W3MwWuHBeYyDxl4EjRJ4y5LJ2-Y_wj27-REAAP__UgYpvw">