public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/89049] [8/9/10/11 Regression] Unexpected vectorization
Date: Thu, 11 Mar 2021 14:10:03 +0000	[thread overview]
Message-ID: <bug-89049-4-XKkPIE3b7W@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-89049-4@http.gcc.gnu.org/bugzilla/>

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|rguenth at gcc dot gnu.org         |unassigned at gcc dot gnu.org
      Known to fail|                            |11.0
   Last reconfirmed|2019-01-25 00:00:00         |2021-3-11
             Status|ASSIGNED                    |NEW

--- Comment #13 from Richard Biener <rguenth at gcc dot gnu.org> ---
Re-confirmed.  Note the same in-order reduction is profitable with SSE:

0x3704d70 *_3 1 times scalar_load costs 12 in body
0x3704d70 _4 + r_16 1 times scalar_stmt costs 12 in body

0x3825d80 _4 + r_16 4 times vec_to_scalar costs 16 in body
0x3825d80 _4 + r_16 4 times scalar_stmt costs 48 in body
0x3825d80 *_3 1 times unaligned_load (misalign -1) costs 12 in body

t4.c:1:53: note:  Cost model analysis:
  Vector inside of loop cost: 76
  Vector prologue cost: 0
  Vector epilogue cost: 0
  Scalar iteration cost: 24
  Scalar outside cost: 0
  Vector outside cost: 0
  prologue iterations: 0
  epilogue iterations: 0
  Calculated minimum iters for profitability: 0


bar:
.LFB0:
        .cfi_startproc
        leaq    4096(%rdi), %rax
        pxor    %xmm1, %xmm1
        .p2align 4,,10
        .p2align 3
.L2:
        movups  (%rdi), %xmm0
        addq    $16, %rdi
        addss   %xmm0, %xmm1
        movaps  %xmm0, %xmm2
        shufps  $85, %xmm0, %xmm2
        addss   %xmm2, %xmm1
        movaps  %xmm0, %xmm2
        unpckhps        %xmm0, %xmm2
        shufps  $255, %xmm0, %xmm0
        addss   %xmm2, %xmm1
        addss   %xmm0, %xmm1
        cmpq    %rdi, %rax
        jne     .L2
        cvttss2sil      %xmm1, %eax
        ret

iff the code in forwprop that decomposes loads of BLKmode vectors used only
by BIT_FIELD_REFs would be relaxed to cover all modes and TARGET_MEM_REFs
that are simple we'd get

.L2:
        addl    $1, %eax
        addss   (%rdi), %xmm0
        addss   4(%rdi), %xmm0
        addq    $16, %rdi
        addss   -8(%rdi), %xmm0
        addss   -4(%rdi), %xmm0
        cmpl    $256, %eax
        jne     .L2

       reply	other threads:[~2021-03-11 14:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-89049-4@http.gcc.gnu.org/bugzilla/>
2021-03-11 14:10 ` rguenth at gcc dot gnu.org [this message]
2021-05-14  9:51 ` [Bug tree-optimization/89049] [9/10/11/12 " jakub at gcc dot gnu.org
2021-06-01  8:12 ` rguenth at gcc dot gnu.org
2022-05-27  9:40 ` [Bug tree-optimization/89049] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:36 ` jakub at gcc dot gnu.org
2023-05-30  8:19 ` [Bug tree-optimization/89049] [10/11/12/13/14 " pinskia at gcc dot gnu.org
2023-07-07 10:34 ` [Bug tree-optimization/89049] [11/12/13/14 " rguenth at gcc dot gnu.org
2024-03-10  5:56 ` [Bug tree-optimization/89049] [11 " law at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-89049-4-XKkPIE3b7W@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).