[PATCH] D113291: [AggressiveInstCombine] Lower Table Based CTTZ and enable it for AARCH64 in -O3

Djordje Todorovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 26 07:46:27 PDT 2022


djtodoro added a comment.

In D113291#3539965 <https://reviews.llvm.org/D113291#3539965>, @efriedma wrote:

>> as for the second I'm not sure when it would be profitable to transform back and emit the table
>
> You really just have to weigh it against the current default expansion on targets where ctlz/cttz aren't legal, which is `popcount(v & -v)`.  It should be a straightforward comparison, generally.  If you have popcount, use it.  If multiply is legal, use a table lookup.  Otherwise... maybe stick with the popcount expansion?  Probably any approach is expensive at that point.
>
> Compare the generated code for arm-eabi.

I guess we could measure something like that, but seems to me that it could introduce some performance regressions...


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113291/new/

https://reviews.llvm.org/D113291



More information about the llvm-commits mailing list