Skip to content
Snippets Groups Projects
Commit 491e5745 authored by Tamar Christina's avatar Tamar Christina
Browse files

middle-end: update vector loop upper bounds when early break vect [PR113734]

When doing early break vectorization we should treat the final iteration as
possibly being partial.  This so that when we calculate the vector loop upper
bounds we take into account that final iteration could have done some work.

The attached testcase shows that if we don't then cunroll may unroll the loop an
if the upper bound is wrong we lose a vector iteration.

This is similar to how we adjust the scalar loop bounds for the PEELED case.

gcc/ChangeLog:

	PR tree-optimization/113734
	* tree-vect-loop.cc (vect_transform_loop): Treat the final iteration of
	an early break loop as partial.

gcc/testsuite/ChangeLog:

	PR tree-optimization/113734
	* gcc.dg/vect/vect-early-break_117-pr113734.c: New test.
parent 0d810b7d
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment