<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/59743>59743</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Vectorize division by runtime constant
</td>
</tr>
<tr>
<th>Labels</th>
<td>
llvm:optimizations,
missed-optimization
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Kmeakin
</td>
</tr>
</table>
<pre>
The [libdivide](https://github.com/ridiculousfish/libdivide) library provides functions to optimize code that divides several integers by the same (but unknown at compiletime) divisor ([example](https://godbolt.org/z/zKrdc49E1)).
LLVM could use the same principle to vectorize divisions on platforms that do not have a vector divide instruction (eg x86-64, AArch64)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8ks1u2zAMx5-GvhAJLDqO44MPabNc2t2G3mWJibXKkqGPrO3TD3IDdMCGHfQBkX-RP5IyRnN1zAO0D9CeKpnT5MPwNLN8Na4avX4ffkyM0D5YM2pzM5qhPQEdppSWCM0R6Ax0vpo05XGr_Ax0DkYbla3P8WLiBHT-klKP1oxBhndcgi9PES_ZqWS8i5g8-iWZ2XwwKq8Z0yQTfkojRr5xkBaNS3zlEHF8xzQxRjkzAh3GnDC7V-d_OZQJlZ8XYzmZeQ1bfok-FEdoH_hNzov9N4rXo7dp68MV6PxR1lPQatd_E0A9UL9FqE9QHz_35-eX76h8thpz5K-ElmCcMovlQnVjlXwoWGsaK6x3uFiZLj7M8Q7q0fmEk7wxyrvmTo_GxRTyWqeCwFd8O-w3-x3QIx6PQU3l2ld6aHTf9LLiQew7atp213XVNHTNXouxF1qLy6hF2x1YtKLt1UHXYmRdmYFqIkHUUyOE6LZMXVePh7quub6QFrCreZbGbq29zaU4lYkx89D23a6prBzZxnWKiIoHNMd7K-XaWyACegSi2cTIevOnsdjaUxWGItyM-RphV1sTU_wKlkyyPLz8VccyBCG70mVU3sUkXapysMN_5nPN7_PYLMH_ZJWAzitOBDqvRL8DAAD__9e5CBw">