public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/100756] New: vect: Superfluous epilog created on s390x
@ 2021-05-25 16:22 rdapp at linux dot ibm.com
  2021-05-26  7:39 ` [Bug tree-optimization/100756] " rguenth at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: rdapp at linux dot ibm.com @ 2021-05-25 16:22 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-05-08 12:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-25 16:22 [Bug tree-optimization/100756] New: vect: Superfluous epilog created on s390x rdapp at linux dot ibm.com
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

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).