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

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <[email protected]>:

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

commit r17-4808-ga9b19ded78ca2dd8f66b355b05ebbbb149c2d320
Author: Richard Biener <[email protected]>
Date:   Thu Oct 1 09:21:30 2026 +0200

    tree-optimization/127686 - mis-applied -O2 vector cost model heuristic

    With -O2 and it's default very-cheap vectorizer cost model we apply
    the heuristic that even when the vector loop is only executed once
    vectorization should be profitable.  But that is applied even when
    the number of iterations is constant where we already assess
    profitability over the whole run.  So do not apply the former heuristic
    in this case.

            PR tree-optimization/127686
            * tree-vect-loop.cc (vect_analyze_loop_costing): Do not
            require a single vector iteration to be profitable iff
            the number of scalar iterations is constant.

Reply via email to