vect: Use adjusted niters by considering peeling prologue
authorKewen Lin <linkw@linux.ibm.com>
Fri, 10 Jul 2020 02:58:28 +0000 (21:58 -0500)
committerKewen Lin <linkw@linux.ibm.com>
Fri, 10 Jul 2020 03:03:26 +0000 (22:03 -0500)
commit08a94a95d10f311d2a83e6f4c076babd8afd6a3e
tree8926a2460243d9a3ca78799d43f0b8761c1b3d48
parent3f8ca9cb86aae8f3742736d3c0ee11d4d1761a48
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.
gcc/tree-vect-loop.c