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/102756] [12 Regression] Complete unrolling is too senative to PRE; c-c++-common/torture/vector-compare-2.c
Date: Wed, 19 Jan 2022 08:22:02 +0000	[thread overview]
Message-ID: <bug-102756-4-rG0AyR7rP6@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102756-4@http.gcc.gnu.org/bugzilla/>

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rsandifo at gcc dot gnu.org

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
Btw, the same happens on x86-64.  With -O2 and vectorization we end up with

  <bb 3> [local count: 858993457]:
  # ivtmp.14_11 = PHI <ivtmp.14_12(5), ivtmp.14_13(2)>
  _14 = (void *) ivtmp.14_11;
  _1 = MEM <int> [(vector(4) int *)_14];
  if (_1 != -3)
    goto <bb 4>; [0.00%]
  else
    goto <bb 5>; [100.00%]

  <bb 4> [count: 0]:
  __builtin_abort ();

  <bb 5> [local count: 858993457]:
  ivtmp.14_12 = ivtmp.14_11 + 4;
  if (ivtmp.14_12 != _16)
    goto <bb 3>; [80.00%]
  else
    goto <bb 6>; [20.00%]

  <bb 6> [local count: 214748368]:
  r ={v} {CLOBBER};

while everything is optimized away with -O2 -fno-tree-vectorize.

Let's keep this open as a regression since -O2 now enables vectorization.  In
principle we could preserve the previous behavior for the very-cheap
vectorizer cost model or adjust the heuristic for that case to only cover
loops with a single BB.

The real issue here is of course the unroller not considering the true
size after simplification.

  parent reply	other threads:[~2022-01-19  8:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-15  0:16 [Bug tree-optimization/102756] New: [12 Regression] Vectorizer change creates poor code for c-c++-common/torture/vector-compare-2.c law at gcc dot gnu.org
2021-10-15  0:29 ` [Bug tree-optimization/102756] [12 Regression] Complete unrolling is too senative to PRE; c-c++-common/torture/vector-compare-2.c pinskia at gcc dot gnu.org
2021-10-15  0:29 ` pinskia at gcc dot gnu.org
2021-10-15  6:25 ` rguenth at gcc dot gnu.org
2021-10-15 14:44 ` law at gcc dot gnu.org
2021-11-17 16:28 ` law at gcc dot gnu.org
2021-11-17 16:29 ` law at gcc dot gnu.org
2022-01-19  8:22 ` rguenth at gcc dot gnu.org [this message]
2022-05-06  8:31 ` [Bug tree-optimization/102756] [12/13 " jakub at gcc dot gnu.org
2022-07-26 13:23 ` rguenth at gcc dot gnu.org
2023-05-08 12:22 ` [Bug tree-optimization/102756] [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-102756-4-rG0AyR7rP6@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).