[Bug target/123149] Missed optimization: GCC doesn't generate AVX512VL rotate instructions for SSE2/AVX2 or/shift/shift

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Dec 16 07:59:35 GMT 2025


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

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
(set (reg:V2DI 109 [ _3 ])
    (xor:V2DI (subreg:V2DI (ashift:V4SI (subreg:V4SI (reg/v:V2DI 105 [ v ]) 0)
                (const_int 5 [0x5])) 0)
        (subreg:V2DI (lshiftrt:V4SI (subreg:V4SI (reg/v:V2DI 105 [ v ]) 0)
                (const_int 27 [0x1b])) 0)))

we could simplify this to

   (subreg:V2DI (xor:V4SI (ashift ...)
                  (lshiftrt ...)))

but not sure if that's a win in general.  OTOH I'd say having the subreg
as outermost operation for a SET_SRC is good as well has having all
subregs apply in innermost position around leaf REG uses.


More information about the Gcc-bugs mailing list