<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/82367>82367</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[SCEV] applyLoopGuards drops information on compilcated SCEV builtin_assumes()
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
komalon1
</td>
</tr>
</table>
<pre>
applyLoopGuards tries to rewrite a SCEV expression using assumes.
It's not working properly if the SCEV **is not** SCEVUnknown.
For example in https://godbolt.org/z/bEs8K35Gs, the loop's trip count is `int num = num1 * num2;` and we have an assume that `__builtin_assume(num % 4 == 0);` but as can be seen, the vectorizer creates an epilogue since it cannot prove there is no tail.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxcks9u4zgMxp9GvhANZNrOn4MPaVMXi93bYvdayDYTaypLgkgnbZ9-IKeDwfQkQSI_fiR_htlePFGrmkfVnAqzyBRS-xZm44Iviz6MH62J0X38E0J8WUwaGSRZYpAAiW7JCoGBf5-e_wd6j4mYbfCwsPUXMMzLTLxR-qT08S9RuGPwQeAW0lsOiClESu4D7BlkoruMwqPCo10j7_f1_T__5sPNb-Cu1oUE9G7m6Aish0kksqqOCjuF3SWMfXCyCemisPtU2PXPvP-7al5Y4dNayoUQVz-SbIQhLF7AMqittl7ALzOo6pTPMhvKF1TVo9pqMH6EG8FkrgTGfzUJMhnJ2a-v_WKdWP96_1C4X8WwgTpLZlWt8PAl1i8ChmEwHnoCJvK_DF5pkJDsJyUYEhkhztUoWhcuCwFbPxBYyal5pDGFa3ZBiWCdHYixblOMbTUeqoMpqC13el_XZd3si6ntx3LEumnq7Vb3TWPO5bjVA5Vo-rosza6wLWqsNaIuG12X1WYYx3OFpamRGnPY7VStac41nLvOedSFZV6o3WO13RXO9OR45QrR0w3WT4WYMUttznnolwurWjvLwr9VxIpbgcxbV80JvvM3phAZrD-HNBvJuAUPQ5ijdYMRGu8Y_bkGVrhXeCiW5NpvrFiZln4zhFlhl018HQ8xhR80iMJutc4Ku7W1nwEAAP__YaMLag">