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

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

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I think this is another case that the PR98287 proposed patch would fix, again
after vec lowering some pass (seems vrp2 in this case), this time it is the
/* Canonicalize X + (X << C) into X * (1 + (1 << C)) and
   (X << C1) + (X << C2) into X * ((1 << C1) + (1 << C2)).  */
match.pd rule, where the target apparently supports V2DImode left shift by
scalar constant and addition, but doesn't support V2DImode multiplication.
Maybe in this particular case it would be worth guarding the pattern on
existing optab for vector multiplication or disable it for vectors altogether
(apparently it was myself who has added that), because at least if the target
doesn't have particular vector multiplications, I'd say doing the additions and
shifts must be better than scalarizing it.  If multiplications are supported, I
guess best would be to let the expansion decide what is better, it has code to
turn scalar multiplications by constant into additions and shifts, so perhaps
could use that also for vector by uniform constants?

Reply via email to