[PATCH] D113291: [AggressiveInstCombine] Lower Table Based CTTZ and enable it for AARCH64 in -O3
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 26 07:13:48 PDT 2022
efriedma added a comment.
> 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.
> You may not want to do that for non-hot ctzs?
As opposed to what, calling into compiler-rt?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D113291/new/
https://reviews.llvm.org/D113291
More information about the llvm-commits
mailing list