https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112325

--- Comment #17 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by hongtao Liu <liuho...@gcc.gnu.org>:

https://gcc.gnu.org/g:ef27b91b62c3aa8841c02665dffa8914c742fd37

commit r15-919-gef27b91b62c3aa8841c02665dffa8914c742fd37
Author: liuhongt <hongtao....@intel.com>
Date:   Tue Feb 27 15:34:57 2024 +0800

    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.

Reply via email to