<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/54735>54735</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[optimization] gcc generate better code than clang base on value range propagation
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
vfdff
</td>
</tr>
</table>
<pre>
after fix the case https://github.com/llvm/llvm-project/issues/54132, the clang still need be improved for some more complex case (see detail on https://godbolt.org/z/jM84xdzGP), such as:
```
int my_abs (int x, int y) {
return x>y ? abs (x-y+1): 0;
}
```
* clang's code:
```
my_abs: // @my_abs
subs w8, w0, w1
b.le .LBB0_2
mvn w9, w8
cmn w8, #1
csinc w0, w9, w8, lt
ret
.LBB0_2:
mov w0, wzr
ret
```
* gcc's code:
```
my_abs:
subs w0, w0, w1
csinc w0, wzr, w0, le
ret
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJylU81u2zAMfhr5QjSwZbuxDz40TbPLBuwNCslmHBWyFUhy_p5-lH_adc2ww2BbJil-5EeClKa5VmLv0cJeXcAfEGrhEA7eHx1Lnxjf0dsqfxjkqjYdKVqflt_D0Zo3rD2pyrkBHQl5lqSc8ecplhZ9C84rraFHbEAiqI5QJ5L3xoIzHUJnLLma7qjxMqVnLzu2eWZF4RChQS-UBtP_yco00mi_MrYl7Ubf248iuzS3bz8XfBmIuKE-gBhx8ZbFy_kYz--oqt5Dd30V0gHjRdAuARuEK-MlsPVmcgSw6Afb0336cgWW7mAGXR7Ic5OQN6WCmKUzgq23d1My_jQ1iPG1o_obnGmX9ylO9ELsqX5gWTzbZmZuICbnIhA_x-OZLFdypRFW3zeb-JUvtu7Uw3lsEWFmW931cwTG03d07VRfLzEXBJ3a_9aUSVxyLN2mNOa0QG_2i_-dprR1_dGS9B_N-Fx7fK_2T-yJwruLxr_TiZoqbcq0FJFXXmPF8o05etWpm_DK9CzfBp7QYo9WeKTJ9mGLAmcafdHPsy_DONPonoQeECyZEGj-j6Idw0SD1dX_LNs6zaNDlaBoyjgpm3T9KFBgwR-l4FlR1FxmMdWghUTtQhGM8x7PMIYgmeqIVMVjzuOMnjLPk3jVyDoruEwynq6lyBMaNOxoB1eBR9i3yFYjJTm0ji61ct59XArnVEvrPqaj-GLwB2Or077Z76MxcTUS_wW4skxV">