<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/118108>118108</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[ValueTracking] `icmp X, C1` implies `(and X, C2) != C3`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
missed-optimization,
llvm:analysis
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
antoniofrighetto
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
dtcxzyw
</td>
</tr>
</table>
<pre>
https://alive2.llvm.org/ce/z/YjUHm-
```
define i1 @src(i64 %x) {
entry:
%cond = icmp ugt i64 %x, 65535
call void @llvm.assume(i1 %cond)
%mask = and i64 %x, -65521
%cmp = icmp eq i64 %mask, 0
ret i1 %cmp
}
define i1 @tgt(i64 %x) {
entry:
ret i1 false
}
```
See also https://github.com/dtcxzyw/llvm-tools/issues/33.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEUkuPmzAQ_jXDxUpkj3keOLCJUO99qD0a7BDv2phik27y6ytTstntoZWiCGlmvs_fQ3ivh1GpGrInQBRjcKN2p1kPZxWCA0TIjolYwtnNtQz96-36K-mcvNbnECYPvAFsAVth9EXh3piL3bt5AGx7BdjeANsfz18_2R3QBnK6_Wgj1UmPimhGIKV-7gFLnacEMHsFrAgUT0AbNYb5GiloQ-Kod6MkwI9E93YiyxDI4-ZA8izj2braC2PIxWkZwdcnCe8XqyIJuwMBVndcK_zLiitG-QFyl2cZsjd6Oz3Y1c_7ZryOy3Tdm1UgG4mdoujiGP__UhyG8H_FG9RJGK8eSO9M_KwUEcY78jGLQYfz0u17ZwHbLTPANhqxC84ZD9hq7xcVPzjfA20SWXNZ8UokqmYFx7IqWFEk51plPaeMp5R2VCLvkXZln1YZS5lMObJE10gxZQwrlrMyTfe04yeW85SWUnBadJBSZYU2b91IVu6asZLRMjGiU8Zv9bPaeyV3bgra6psI2o2xgXgAxHgOvBGjMFev_dbMuV5ldcvgY9baB_8gCjqYtdnfhFnUl1n0L3ocIDsSyOma4vcY3IFBTom2k9HKxxFgGZvwZ4hrOshi8gcOOU2W2dT_cHx96Gb3NLtn1Yf3hm-6LzX-DgAA__94bwMt">