public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/c++-coroutines] vect: Use adjusted niters by considering peeling prologue
@ 2020-07-10 20:29 Iain D Sandoe
  0 siblings, 0 replies; only message in thread
From: Iain D Sandoe @ 2020-07-10 20:29 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:08a94a95d10f311d2a83e6f4c076babd8afd6a3e

commit 08a94a95d10f311d2a83e6f4c076babd8afd6a3e
Author: Kewen Lin <linkw@linux.ibm.com>
Date:   Thu Jul 9 21:58:28 2020 -0500

    vect: Use adjusted niters by considering peeling prologue
    
    This patch is derived from the review of vector with length patch
    series.  I relaxed the guard on LOOP_VINFO_PEELING_FOR_ALIGNMENT for
    vector with length as Richard S.'s suggestion, then encountered one
    failure from case gcc.dg/vect/vect-ifcvt-11.c with param
    vect-partial-vector-usage=2 enablement run.  The root cause is that
    we still use the original niters for the loop body vectorization,
    it leads the access to go out of bound, instead we should use
    LOOP_VINFO_NITERS which has been adjusted in vect_do_peeling by
    considering the peeling number for prologue.
    
    Bootstrapped/regtested on aarch64-linux-gnu and powerpc64le-linux-gnu.
    
    gcc/ChangeLog:
    
            * tree-vect-loop.c (vect_transform_loop): Use LOOP_VINFO_NITERS which
            is adjusted by considering peeled prologue for non
            vect_use_loop_mask_for_alignment_p cases.

Diff:
---
 gcc/tree-vect-loop.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 6ec16475c66..0a9be35ddec 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -8615,9 +8615,15 @@ vect_transform_loop (loop_vec_info loop_vinfo, gimple *loop_vectorized_call)
 			     LOOP_VINFO_INT_NITERS (loop_vinfo) / lowest_vf);
 	  step_vector = build_one_cst (TREE_TYPE (niters));
 	}
-      else
+      else if (vect_use_loop_mask_for_alignment_p (loop_vinfo))
 	vect_gen_vector_loop_niters (loop_vinfo, niters, &niters_vector,
 				     &step_vector, niters_no_overflow);
+      else
+	/* vect_do_peeling subtracted the number of peeled prologue
+	   iterations from LOOP_VINFO_NITERS.  */
+	vect_gen_vector_loop_niters (loop_vinfo, LOOP_VINFO_NITERS (loop_vinfo),
+				     &niters_vector, &step_vector,
+				     niters_no_overflow);
     }
 
   /* 1) Make sure the loop header has exactly two entries


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-07-10 20:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-10 20:29 [gcc/devel/c++-coroutines] vect: Use adjusted niters by considering peeling prologue Iain D Sandoe

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