<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/58408>58408</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
eliminate urem using range info
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
rotateright
</td>
</tr>
</table>
<pre>
Forking this off from issue #58253 (that's requesting a more difficult analysis):
We can eliminate urem based on known ranges of the dividend and divisor:
https://alive2.llvm.org/ce/z/AloXWL
I think this could be implemented in any of SCCP, CVP, or InstSimplify.
SCCP already handles the related case with udiv:
https://alive2.llvm.org/ce/z/6yAS5y
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVUkuP2yAQ_jX4Mmpk49gxBw5pVpFW6qFSpG6v2IxtGgwpj0Tury94V9ttb5V4DY_vMUNv5crP1l2VmSDMyoMdRxidXUB5HxEIrZuONnVadGEWgdCDB4c_I_qQ3whYrEOQahzVEHUAYYRevfKEMlIfSflEyrfxBWEQBlCrRRkREKLDBXrhUYI1cDX2YcAJM2FWkdRk2LuSaGRClVvgrXtHnUO4-RzRc2pCqzvSndb3ZWfdlHYGTMOv1I_afn_58lHKc_Zqrq-OBxu1hB5BLTeNC5qQBCmTONes43I6fSX0BKdv22QdPBsfLvmyGtcdfMTNd0Foh0KuMCfROnnJRhxqkWGH5BYeKswQk53_t9Kux0uzFsirtm3LirKWFZLXktVMFEEFjfyf_Eafy7SlNZkabRGd5n_zTUlP7HeDXVKQWd-mTzdnf-CQan7ePkOq6bnp9mVXzPzAqh7bvWiauqyF7IaOdgPr-kF0o2CIhRY9as9J85lQavDx-p_SmjRPheK0pLQqq0NVU7pnu5K1B0mZLCvZUNa1ZF_iIpR-T0Lh-Capj5NPh1r54P8cCu_VZBA3uoQvYpit486GlAenpjkUGz3f5P8GCTHzzw">