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

--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to JuzheZhong from comment #11)
> I think this following:
> 
> https://godbolt.org/z/5sWEWWGox
> 
> ARM SVE GCC-11 correctly vectorize this codes.
> 
> But both GCC-12 and GCC-13 failed to vectorize it.
> 
> GCC-14 vectorize it in a wrong way.
> 
> Would it be possible to recover it back to GCC-11 ?

With GCC 11 it probably SLP vectorizes the completely unrolled nest.  That
can be recovered with -fno-tree-loop-vectorize on trunk which on x86_64
produces

main:
.LFB0:
        .cfi_startproc
        movl    a+4(%rip), %edx
        xorl    %eax, %eax
        movl    $2, b(%rip)
        testl   %edx, %edx
        sete    %al
        movd    %eax, %xmm0
        setne   %al
        movzbl  %al, %eax
        pshufd  $0, %xmm0, %xmm0
        movups  %xmm0, a+4(%rip)
        movd    %eax, %xmm1
        movups  %xmm0, a+20(%rip)
        pshufd  $0, %xmm1, %xmm0
        movups  %xmm0, a+40(%rip)
        movups  %xmm0, a+56(%rip)
        ret

Reply via email to