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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Avinash Jayakar <[email protected]>:

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

commit r16-5095-gbc62a2fbabad0402e96640b834d7c8a9f64c11db
Author: Avinash Jayakar <[email protected]>
Date:   Sat Nov 8 08:23:31 2025 +0530

    vect: Complete implementation for MULT_EXPR vector lowering.

    Use sequences of shifts and add/sub if the hardware does not have support
for
    vector multiplication. In a previous patch, bare bones vector lowering had
been
    implemented which only worked when the constant value was a power of 2.

    In this patch, few more cases have been added, i.e., if a constant is a
uniform
    vector but not a power of 2 then use the choose_mult_variant, with max cost
    estimate as the cost of scalar multiplication operation times the number of
    elements in the vector. This is similar to the logic while expanding
MULT_EXPR
    in expand pass or in the vector pattern recognition in
tree-vect-patterns.cc.

    2025-11-08  Avinash Jayakar  <[email protected]>

    gcc/ChangeLog:
            PR tree-optimization/122065
            * tree-vect-generic.cc (target_supports_mult_synth_alg): Add helper
to
            check mult synth.
            (expand_vector_mult): Optimize mult when const is uniform but not
            power of 2.

Reply via email to