Fix PEELING_FOR_NITERS calculation (PR 87288)
authorRichard Sandiford <richard.sandiford@arm.com>
Thu, 20 Sep 2018 12:58:23 +0000 (12:58 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Thu, 20 Sep 2018 12:58:23 +0000 (12:58 +0000)
commit2d2ee18641557deba692c286cbc2d8751310f697
treed8c4f81ba2a6850b20fcfc807b297787b0a8afe3
parent508a909eca536f7f6a60af9bd7ecea761bd2e8f1
Fix PEELING_FOR_NITERS calculation (PR 87288)

PEELING_FOR_GAPS now means "peel one iteration for the epilogue",
in much the same way that PEELING_FOR_ALIGNMENT > 0 means
"peel that number of iterations for the prologue".  We weren't
taking this into account when deciding whether we needed to peel
further scalar iterations beyond the iterations for "gaps" and
"alignment".

Only the first test failed before the patch.  The other two
are just for completeness.

2018-09-20  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
PR tree-optimization/87288
* tree-vect-loop.c (vect_analyze_loop_2): Take PEELING_FOR_GAPS
into account when determining PEELING_FOR_NITERS.

gcc/testsuite/
PR tree-optimization/87288
* gcc.dg/vect/pr87288-1.c: New test.
* gcc.dg/vect/pr87288-2.c: Likewise,
* gcc.dg/vect/pr87288-3.c: Likewise.

From-SVN: r264440
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/pr87288-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/pr87288-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/pr87288-3.c [new file with mode: 0644]
gcc/tree-vect-loop.c