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/108601] [13 Regression] vector peeling ICEs with PGO + LTO + IPA inlining in gcc_r in SPEC2017
Date: Tue, 31 Jan 2023 07:29:08 +0000	[thread overview]
Message-ID: <bug-108601-4-Bt311tY4wH@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108601-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
So for the trivial

void
__attribute__((noipa))
foo_mul (int* a, int b, int n)
{
  for (int i = 0; i != N; i++)
    {
      a[i] = b;
      b *= 3;
    }
}


I get

t.c:5:21: note:   examining phi: b_17 = PHI <b_12(6), b_7(D)(5)>
t.c:5:21: missed:   Peeling for epilogue is not supported for nonlinear
induction except neg when iteration count is unknown.
t.c:3:1: missed:   not vectorized: relevant phi not supported: b_17 = PHI
<b_12(6), b_7(D)(5)>
t.c:5:21: missed:  bad operation or unsupported loop bound.

so for some reason this check doesn't trigger for the case in SPEC?  The
check seems to be

vect_can_peel_nonlinear_iv_p (loop_vec_info loop_vinfo,
                              enum vect_induction_op_type induction_type)
{
  tree niters_skip;
  /* Init_expr will be update by vect_update_ivs_after_vectorizer,
     if niters is unkown:
     For shift, when shift mount >= precision, there would be UD.
     For mult, don't known how to generate
     init_expr * pow (step, niters) for variable niters.
     For neg, it should be ok, since niters of vectorized main loop
     will always be multiple of 2.  */
  if (!LOOP_VINFO_NITERS_KNOWN_P (loop_vinfo)
      && induction_type != vect_step_op_neg)
    {
      if (dump_enabled_p ())
        dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
                         "Peeling for epilogue is not supported"
                         " for nonlinear induction except neg"
                         " when iteration count is unknown.\n");
      return false;
    }

that might not be entirely sufficient to detect all epilogue peeling cases.

  parent reply	other threads:[~2023-01-31  7:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-30 15:43 [Bug tree-optimization/108601] New: " tnfchris at gcc dot gnu.org
2023-01-30 16:05 ` [Bug tree-optimization/108601] " pinskia at gcc dot gnu.org
2023-01-31  7:25 ` rguenth at gcc dot gnu.org
2023-01-31  7:29 ` rguenth at gcc dot gnu.org [this message]
2023-01-31  7:49 ` crazylht at gmail dot com
2023-01-31  8:28 ` crazylht at gmail dot com
2023-01-31  9:05 ` tnfchris at gcc dot gnu.org
2023-01-31 20:24 ` [Bug tree-optimization/108601] [13 Regression] vector peeling ICEs with VLA in gcc_r in SPEC2017 since g:c13223b790bbc5e4a3f5605e057eac59b61b2c85 tnfchris at gcc dot gnu.org
2023-01-31 21:08 ` tnfchris at gcc dot gnu.org
2023-02-01  5:32 ` crazylht at gmail dot com
2023-02-01  7:29 ` crazylht at gmail dot com
2023-02-01  7:32 ` rguenther at suse dot de
2023-02-01  7:46 ` crazylht at gmail dot com
2023-02-01  8:41 ` rguenth at gcc dot gnu.org
2023-02-01  9:07 ` crazylht at gmail dot com
2023-02-02  9:02 ` cvs-commit at gcc dot gnu.org
2023-02-03  8:05 ` 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-108601-4-Bt311tY4wH@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).