Fix PEELING_FOR_NITERS calculation (PR 87288)

Programming / Compilers / GCC - rsandifo [138bc75d-0d04-0410-961f-82ee72b054a4] - 20 September 2018 12:58 EDT

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

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.

c333203af43 Fix PEELING_FOR_NITERS calculation (PR 87288)
gcc/ChangeLog | 6 ++++
gcc/testsuite/ChangeLog | 7 ++++
gcc/testsuite/gcc.dg/vect/pr87288-1.c | 49 +++++++++++++++++++++++++++
gcc/testsuite/gcc.dg/vect/pr87288-2.c | 64 +++++++++++++++++++++++++++++++++++
gcc/testsuite/gcc.dg/vect/pr87288-3.c | 64 +++++++++++++++++++++++++++++++++++
gcc/tree-vect-loop.c | 14 ++++++--
6 files changed, 201 insertions(+), 3 deletions(-)

Upstream: gcc.gnu.org


  • Share