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 middle-end/111125] [14 Regression] tree-ssa.exp and vect.exp failures after commit r14-3281-g99b5921bfc8f91
Date: Thu, 24 Aug 2023 08:54:12 +0000	[thread overview]
Message-ID: <bug-111125-4-Qan9tX5RCw@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-111125-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
gcc.dg/vect/pr53773.c is interesting - we vectorize the function to

  <bb 2> [local count: 118111600]:
  _20 = {integral_4(D), decimal_5(D)};
  if (power_ten_6(D) > 0)
    goto <bb 3>; [89.00%]
  else
    goto <bb 4>; [11.00%]

  <bb 3> [local count: 955630224]:
  # power_ten_19 = PHI <power_ten_11(3), power_ten_6(D)(2)>
  # vect_integral_15.4_1 = PHI <vect_integral_9.5_12(3), _20(2)>
  vect_integral_9.5_12 = vect_integral_15.4_1 * { 10, 10 };
  power_ten_11 = power_ten_19 + -1;
  if (power_ten_11 != 0)
    goto <bb 3>; [89.00%]
  else
    goto <bb 4>; [11.00%]

  <bb 4> [local count: 118111600]:
  # vect_integral_16.7_21 = PHI <vect_integral_9.5_12(3), _20(2)>
  _22 = VIEW_CONVERT_EXPR<vector(2) unsigned int>(vect_integral_16.7_21);
  _23 = .REDUC_PLUS (_22); [tail call]
  _24 = (int) _23;
  return _24;

where loop vectorization fails because

/space/rguenther/src/gcc/gcc/testsuite/gcc.dg/vect/pr53773.c:9:20: note: 
Analyze phi: integral_15 = PHI <integral_9(6), integral_4(D)(5)>
/space/rguenther/src/gcc/gcc/testsuite/gcc.dg/vect/pr53773.c:9:20: missed: 
Peeling for epilogue is not supported for nonlinear induction except neg when
iteration count is unknown.
/space/rguenther/src/gcc/gcc/testsuite/gcc.dg/vect/pr53773.c:9:20: missed:  not
vectorized: can't create required epilog loop

loop vectorization doesn't try SLP here because we only SLP reduction groups,
not induction groups.

So I think this vectorization is quite nice, possibly even better than
the loop vectorization we expect.  generated code:

foo:
.LFB0:
        .cfi_startproc
        fmov    s31, w0
        ins     v31.s[1], w1
        cmp     w2, 0
        ble     .L2
        movi    v30.2s, 0xa
        .p2align 3,,7
.L3:
        mul     v31.2s, v31.2s, v30.2s
        subs    w2, w2, #1
        bne     .L3
.L2:
        addp    v31.2s, v31.2s, v31.2s
        fmov    w0, s31
        ret

the path for power_ten == 0 is of course sub-optimal.  Note it's again
determined not profitable with costing (we do not try to weight stmts
based on profile, thus in-loop stmts cost the same as out-of-loop stmts).

I'm going to adjust the testcase, disabling BB vectorization.

  parent reply	other threads:[~2023-08-24  8:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-24  2:05 [Bug middle-end/111125] New: tree-ssa.exp and vect.exp failures after commit 99b5921bfc8f thiago.bauermann at linaro dot org
2023-08-24  7:41 ` [Bug middle-end/111125] [14 Regression] tree-ssa.exp and vect.exp failures after commit r14-3281-g99b5921bfc8f91 rguenth at gcc dot gnu.org
2023-08-24  8:15 ` rguenth at gcc dot gnu.org
2023-08-24  8:44 ` rguenth at gcc dot gnu.org
2023-08-24  8:54 ` rguenth at gcc dot gnu.org [this message]
2023-08-24  8:59 ` cvs-commit at gcc dot gnu.org
2023-08-24  9:36 ` cvs-commit at gcc dot gnu.org
2023-08-24 11:03 ` cvs-commit at gcc dot gnu.org
2023-08-24 11:03 ` rguenth at gcc dot gnu.org
2023-08-24 15:38 ` thiago.bauermann at linaro dot 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-111125-4-Qan9tX5RCw@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).