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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Sandiford <rsand...@gcc.gnu.org>:

https://gcc.gnu.org/g:d17a896da1e898928d337596d029f0ece0039d55

commit r11-311-gd17a896da1e898928d337596d029f0ece0039d55
Author: Richard Sandiford <richard.sandif...@arm.com>
Date:   Tue May 12 09:01:10 2020 +0100

    tree: Add vector_element_bits(_tree) [PR94980 1/3]

    A lot of code that wants to know the number of bits in a vector
    element gets that information from the element's TYPE_SIZE,
    which is always equal to TYPE_SIZE_UNIT * BITS_PER_UNIT.
    This doesn't work for SVE and AVX512-style packed boolean vectors,
    where several elements can occupy a single byte.

    This patch introduces a new pair of helpers for getting the true
    (possibly sub-byte) size.  I made a token attempt to convert obvious
    element size calculations, but I'm sure I missed some.

    2020-05-12  Richard Sandiford  <richard.sandif...@arm.com>

    gcc/
            PR tree-optimization/94980
            * tree.h (vector_element_bits, vector_element_bits_tree): Declare.
            * tree.c (vector_element_bits, vector_element_bits_tree): New.
            * match.pd: Use the new functions instead of determining the
            vector element size directly from TYPE_SIZE(_UNIT).
            * tree-vect-data-refs.c (vect_gather_scatter_fn_p): Likewise.
            * tree-vect-patterns.c (vect_recog_mask_conversion_pattern):
Likewise.
            * tree-vect-stmts.c (vect_is_simple_cond): Likewise.
            * tree-vect-generic.c (expand_vector_piecewise): Likewise.
            (expand_vector_conversion): Likewise.
            (expand_vector_addition): Likewise for a TYPE_SIZE_UNIT used as
            a divisor.  Convert the dividend to bits to compensate.
            * tree-vect-loop.c (vectorizable_live_operation): Call
            vector_element_bits instead of open-coding it.

Reply via email to