]> git.ipfire.org Git - thirdparty/gcc.git/commit
vect: Relax known iteration number constraint
authorVictor Do Nascimento <victor.donascimento@arm.com>
Thu, 8 May 2025 14:28:05 +0000 (15:28 +0100)
committerVictor Do Nascimento <victor.donascimento@arm.com>
Mon, 15 Dec 2025 15:27:40 +0000 (15:27 +0000)
commitca8d97f8cb8d282c190183e9c297d5e0490bab4e
tree69d6755ffb3ebc420f7db693d6e23b1bd4f2d099
parent89fb47c1ce4e0762e469cc76fe56e44ddab0969a
vect: Relax known iteration number constraint

At present we reject uncounted loops outright when doing initial loop
analysis in `vect_analyze_loop_form'.

We have the following gating condition that causes rejection of a
given loop:

 if (integer_zerop (info->assumptions)
      || !info->number_of_iterations
      || chrec_contains_undetermined (info->number_of_iterations))

We can do away with this check altogether, but not without problems,
allowing many malformed loops through which ought to be rejected as
early as possible.

We observe that a common thread running through these malformed loops
is the absence of any scalar evolution between iterations.

We have therefore adjusted the analysis replacing the checks on
`niters' for a test for the presence of scalar evolution in the loop,
which can be detected via the presence of phi nodes in the loop.

gcc/ChangeLog:

* tree-vect-loop.cc (vect_analyze_loop_form): Relax niters
condition.
gcc/tree-vect-loop.cc