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

--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:801b2c880c8079934ac186ea1c31f3bf4af5aef3

commit r12-6202-g801b2c880c8079934ac186ea1c31f3bf4af5aef3
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Tue Jan 4 10:12:17 2022 +0100

    shrink-wrapping: Don't call can_get_prologue unnecessarily [PR103860]

    On Thu, Dec 30, 2021 at 04:08:25AM -0600, Segher Boessenkool wrote:
    > > The following simple patch makes sure we call can_get_prologue even
after
    > > the last former iteration when vec is already empty and only break from
    > > the loop afterwards (and only if the updating of pro done because of
    > > !can_get_prologue didn't push anything into vec again).

    During the development of the above patch I've noticed that in many cases
    we call can_get_prologue often on the same pro again and again and again,
    we can have many basic blocks pushed into vec and if most of those don't
    require pro updates, i.e.
          basic_block bb = vec.pop ();
          if (!can_dup_for_shrink_wrapping (bb, pro, max_grow_size))
            while (!dominated_by_p (CDI_DOMINATORS, bb, pro))
    isn't true, then pro is can_get_prologue checked for each bb in the vec.

    The following simple patch just remembers which bb we've verified already
    and verifies again only when pro changes.  Most of the patch is just
    reindentation.

    2022-01-04  Jakub Jelinek  <ja...@redhat.com>

            PR rtl-optimization/103860
            * shrink-wrap.c (try_shrink_wrapping): Don't call can_get_prologue
            uselessly for blocks for which it has been called already.
  • [Bug rtl-optimization/103860] [... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to