public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rdapp at linux dot ibm.com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/100756] New: vect: Superfluous epilog created on s390x
Date: Tue, 25 May 2021 16:22:26 +0000	[thread overview]
Message-ID: <bug-100756-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 100756
           Summary: vect: Superfluous epilog created on s390x
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rdapp at linux dot ibm.com
  Target Milestone: ---

Since g:d846f225c25c5885250c303c8d118caa08c447ab we create an epilog loop on
s390 for the following test case:

/* { dg-do compile } */
/* { dg-options "-O3 -mzarch -march=z13" } */
/* { dg-require-effective-target s390_vx } */

int
foo (int * restrict a, int n)
{
  int i, result = 0;

  for (i = 0; i < n * 4; i++)
    result += a[i];
  return result;
}

vec.c:10:17: note:  epilog loop required

The following check in
tree-vect-loop.c:vect_need_peeling_or_partial_vectors_p() is now true:

               || ((tree_ctz (LOOP_VINFO_NITERS (loop_vinfo))                   
                     < (unsigned) exact_log2 (const_vf)) 

We now have LOOP_VINFO_NITERS (loop_vinfo) = _15 > 0 ? (unsigned int) _15 : 1
as compared to (unsigned int) _15 before. tree_ctz() returns 0 for the
conditional and 2 before which did not trigger the epilog requirement.

may_be_zero is _15 > 0 so it looks to me like we rather want to check the
not-may_be_zero part of niter for alignment. Not sure if this is the right/safe
thing to do, though.

             reply	other threads:[~2021-05-25 16:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-25 16:22 rdapp at linux dot ibm.com [this message]
2021-05-26  7:39 ` [Bug tree-optimization/100756] " rguenth at gcc dot gnu.org
2022-03-25  9:45 ` rdapp at linux dot ibm.com
2022-03-25  9:53 ` rguenth at gcc dot gnu.org
2022-10-20 12:04 ` rdapp at gcc dot gnu.org
2022-10-21 12:21 ` [Bug tree-optimization/100756] [12/13 Regression] " rguenth at gcc dot gnu.org
2022-10-25  8:03 ` cvs-commit at gcc dot gnu.org
2022-10-25  8:03 ` [Bug tree-optimization/100756] [12 " rguenth at gcc dot gnu.org
2022-10-25  8:03 ` rguenth at gcc dot gnu.org
2023-02-01  9:31 ` rguenth at gcc dot gnu.org
2023-02-01  9:59 ` rdapp at gcc dot gnu.org
2023-05-08 12:22 ` 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-100756-4@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).