]> git.ipfire.org Git - thirdparty/gcc.git/commit
Don't reduce estimated unrolled size for innermost loop.
authorliuhongt <hongtao.liu@intel.com>
Tue, 27 Feb 2024 07:34:57 +0000 (15:34 +0800)
committerliuhongt <hongtao.liu@intel.com>
Thu, 30 May 2024 05:39:37 +0000 (13:39 +0800)
commitef27b91b62c3aa8841c02665dffa8914c742fd37
tree5e127b7a296ef1b8f66d61f2c7147abcf30400ba
parentbdc264a16e327c63d133131a695a202fbbc0a6a0
Don't reduce estimated unrolled size for innermost loop.

For the innermost loop, after completely loop unroll, it will most likely
not be able to reduce the body size to 2/3. The current 2/3 reduction
will make some of the larger loops completely unrolled during
cunrolli, which will then result in them not being able to be
vectorized. It also increases the register pressure.

The patch move the 2/3 reduction from estimated_unrolled_size to
tree_unroll_loops_completely.

gcc/ChangeLog:

PR tree-optimization/112325
* tree-ssa-loop-ivcanon.cc (estimated_unrolled_size): Move the
2 / 3 loop body size reduction to ..
(try_unroll_loop_completely): .. here, add it for the check of
body size shrink, and the check of comparison against
param_max_completely_peeled_insns when
(!cunrolli ||loop->inner).
(canonicalize_loop_induction_variables): Add new parameter
cunrolli and pass down.
(tree_unroll_loops_completely_1): Ditto.
(canonicalize_induction_variables): Pass cunrolli as false to
canonicalize_loop_induction_variables.
(tree_unroll_loops_completely): Set cunrolli to true at
beginning and set it to false after CHANGED is true.

gcc/testsuite/ChangeLog:

* gcc.dg/vect/pr112325.c: New test.
gcc/testsuite/gcc.dg/vect/pr112325.c [new file with mode: 0644]
gcc/tree-ssa-loop-ivcanon.cc