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 target/104912] [12 Regression] 416.gamess regression after r12-7612-g69619acd8d9b58
Date: Mon, 21 Mar 2022 13:08:49 +0000	[thread overview]
Message-ID: <bug-104912-4-rCTVPHJQuB@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-104912-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
I'm noting that for skylake cost we have

  _28 * _33 1 times scalar_stmt costs 16 in prologue

and

  _28 * _33 1 times vector_stmt costs 16 in body

but the load/store costs are just 12, compared to znver2 this tips the bias
over to allow vectorization while for znver2 I currently see no vectorization.
For generic I also see vectorization.

Note that costing currently assumes that the cost model niter check is
performed first and short-cuts all the versioning conditions.  But since
we emit

  _248 = (unsigned int) mk_113;
  _247 = _248 + 4294967295;
  _246 = _247 > 2;
  _245 = stride.4_74 != 0;
  _244 = _245 & _246;
...
  _183 = _184 | _211;
  _182 = _183 & _244;
  if (_182 != 0)
    goto <bb 27>; [80.00%]
  else
    goto <bb 28>; [20.00%]

on GIMPLE how things are expanded depends on some luck and with the standalone
testcase and -Ofast with generic tuning we emit the > 2 cost model check
quite late:

        addq    $1, %rdi
        imulq   %r13, %rdi
        leaq    (%rax,%rdi), %rcx
        movq    32(%rsp), %rax
        leaq    (%rax,%rcx), %rsi
        movq    (%rsp), %rax
        leaq    0(,%rsi,8), %rdx
        addq    %rax, %rcx
        leaq    0(,%rcx,8), %rax
        addq    %r13, %rcx
        salq    $3, %rcx
        cmpq    %rcx, %rdx
        setg    %cl
        addq    %r13, %rsi
        salq    $3, %rsi
        cmpq    %rsi, %rax
        setg    %sil
        orb     %cl, %sil
        je      .L8
        movl    -100(%rsp), %esi
        leal    -1(%rsi), %ecx
        cmpl    $2, %ecx             <-----
        movl    112(%rsp), %ecx
        seta    %sil
        testl   %ecx, %ecx
        setg    %cl
        testb   %cl, %sil
        je      .L8

let me try to hack^Wfix this.

  parent reply	other threads:[~2022-03-21 13:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-14 11:06 [Bug target/104912] New: [12 Regression] 416.gamess regression after r12-7612 rguenth at gcc dot gnu.org
2022-03-14 11:06 ` [Bug target/104912] " rguenth at gcc dot gnu.org
2022-03-14 11:55 ` [Bug target/104912] [12 Regression] 416.gamess regression after r12-7612-g69619acd8d9b58 rguenth at gcc dot gnu.org
2022-03-14 11:58 ` rguenth at gcc dot gnu.org
2022-03-14 12:17 ` rguenth at gcc dot gnu.org
2022-03-14 13:49 ` rguenth at gcc dot gnu.org
2022-03-14 14:25 ` rguenth at gcc dot gnu.org
2022-03-17 12:31 ` rguenth at gcc dot gnu.org
2022-03-21 13:08 ` rguenth at gcc dot gnu.org [this message]
2022-04-13  7:54 ` cvs-commit at gcc dot gnu.org
2022-04-13  8:02 ` rguenth at gcc dot gnu.org
2022-04-20 11:28 ` cvs-commit at gcc dot gnu.org
2022-05-06  8:33 ` [Bug target/104912] [12/13 " jakub at gcc dot gnu.org
2022-07-26 12:42 ` rguenth at gcc dot gnu.org
2023-01-31 11:22 ` jamborm at gcc dot gnu.org
2023-01-31 12:02 ` rguenth at gcc dot gnu.org
2023-05-08 12:24 ` [Bug target/104912] [12/13/14 " rguenth 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-104912-4-rCTVPHJQuB@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).