public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/64909] New: [4.8/5 regression] Missed vectorization
@ 2015-02-02 21:55 hubicka at gcc dot gnu.org
  2015-02-02 21:57 ` [Bug middle-end/64909] " hubicka at gcc dot gnu.org
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: hubicka at gcc dot gnu.org @ 2015-02-02 21:55 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 64909
           Summary: [4.8/5 regression] Missed vectorization
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hubicka at gcc dot gnu.org

Hi,
the following loop (taken from firefox unicode stuff)
unsigned short a[32];
unsigned int b[32];
t()
{
  int i;
  for (i=0;i<12;i++)
    b[i]=a[i];
}

compiles by clang to:
t:                                      # @t
        .cfi_startproc
# BB#0:
        vpmovzxwd       a(%rip), %xmm0
        vmovdqa .LCPI0_0(%rip), %xmm1   # xmm1 = [65535,65535,65535,65535]
        vpand   %xmm1, %xmm0, %xmm0
        vmovdqa %xmm0, b(%rip)
        vpmovzxwd       a+8(%rip), %xmm0
        vpand   %xmm1, %xmm0, %xmm0
        vmovdqa %xmm0, b+16(%rip)
        vpmovzxwd       a+16(%rip), %xmm0
        vpand   %xmm1, %xmm0, %xmm0
        vmovdqa %xmm0, b+32(%rip)
        retq

GCC 4.7 does:
t:
.LFB0:
        .cfi_startproc
        movzwl  a+16(%rip), %eax
        vmovaps a(%rip), %xmm0
        vpmovzxwd       %xmm0, %xmm1
        vpsrldq $8, %xmm0, %xmm0
        vpmovzxwd       %xmm0, %xmm0
        movl    %eax, b+32(%rip)
        movzwl  a+18(%rip), %eax
        vmovaps %xmm1, b(%rip)
        vmovaps %xmm0, b+16(%rip)
        movl    %eax, b+36(%rip)
        movzwl  a+20(%rip), %eax
        movl    %eax, b+40(%rip)
        movzwl  a+22(%rip), %eax
        movl    %eax, b+44(%rip)
        ret

while 4.8 and mainline unrolls and keeps it that way:

t:
.LFB0:
        .cfi_startproc
        movzwl  a(%rip), %eax
        movl    %eax, b(%rip)
        movzwl  a+2(%rip), %eax
        movl    %eax, b+4(%rip)
        movzwl  a+4(%rip), %eax
        movl    %eax, b+8(%rip)
        movzwl  a+6(%rip), %eax
        movl    %eax, b+12(%rip)
        movzwl  a+8(%rip), %eax
        movl    %eax, b+16(%rip)
        movzwl  a+10(%rip), %eax
        movl    %eax, b+20(%rip)
        movzwl  a+12(%rip), %eax
        movl    %eax, b+24(%rip)
        movzwl  a+14(%rip), %eax
        movl    %eax, b+28(%rip)
        movzwl  a+16(%rip), %eax
        movl    %eax, b+32(%rip)
        movzwl  a+18(%rip), %eax
        movl    %eax, b+36(%rip)
        movzwl  a+20(%rip), %eax
        movl    %eax, b+40(%rip)
        movzwl  a+22(%rip), %eax
        movl    %eax, b+44(%rip)
        ret


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2015-06-23  8:59 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-02 21:55 [Bug middle-end/64909] New: [4.8/5 regression] Missed vectorization hubicka at gcc dot gnu.org
2015-02-02 21:57 ` [Bug middle-end/64909] " hubicka at gcc dot gnu.org
2015-02-02 23:43 ` hjl.tools at gmail dot com
2015-02-09  0:07 ` pinskia at gcc dot gnu.org
2015-02-09 13:57 ` jakub at gcc dot gnu.org
2015-02-09 14:26 ` rguenth at gcc dot gnu.org
2015-02-09 14:38 ` jakub at gcc dot gnu.org
2015-02-09 14:50 ` rguenth at gcc dot gnu.org
2015-02-09 21:56 ` [Bug middle-end/64909] " jakub at gcc dot gnu.org
2015-02-09 22:05 ` hubicka at gcc dot gnu.org
2015-02-10  8:50 ` [Bug target/64909] [4.8/4.9/5 Regression] Missed vectorization with bdver1 rguenth at gcc dot gnu.org
2015-02-10  9:09 ` rguenth at gcc dot gnu.org
2015-02-10 11:49 ` [Bug tree-optimization/64909] " rguenth at gcc dot gnu.org
2015-02-10 11:50 ` [Bug tree-optimization/64909] [4.8/4.9 " rguenth at gcc dot gnu.org
2015-02-23 12:14 ` rguenth at gcc dot gnu.org
2015-04-04 10:47 ` [Bug tree-optimization/64909] [4.8 " rguenth at gcc dot gnu.org
2015-04-07 13:41 ` rguenth at gcc dot gnu.org
2015-06-23  8:59 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).