[Bug tree-optimization/109011] missed optimization in presence of __builtin_ctz

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Mar 3 20:21:48 GMT 2023


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109011

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Seems they are vectorizing __builtin_ctz (x) as bitsize - .CLZ ((x - 1) & ~x)
for CLZ_DEFINED_VALUE_AT_ZERO 2 with value bitsize.
Perhaps we should pattern match it in tree-vect-patterns.cc that way if clz is
vectorizable (it is with -mavx512cd) and ctz is not.


More information about the Gcc-bugs mailing list