public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Richard Biener <rguenth@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-1604] More update-ssa speedup
Date: Mon, 11 Jul 2022 11:48:31 +0000 (GMT)	[thread overview]
Message-ID: <20220711114831.A0D9D385C320@sourceware.org> (raw)

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

commit r13-1604-gf1782a0a8c46a8897923f8e7aaf3846e86434170
Author: Richard Biener <rguenther@suse.de>
Date:   Mon Jul 11 12:17:40 2022 +0200

    More update-ssa speedup
    
    When working on a smaller region like a loop version copy the main
    time spent is now dominance fast query recompute which does a full
    function DFS walk.  The dominance queries within the region of
    interest should be O(log n) without fast queries and we should do
    on the order of O(n) of them which overall means reasonable
    complexity.
    
    For the artificial testcase I'm looking at this shaves off
    considerable time again.
    
            * tree-into-ssa.cc (update_ssa): Do not forcefully
            re-compute dominance fast queries for TODO_update_ssa_no_phi.

Diff:
---
 gcc/tree-into-ssa.cc | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/gcc/tree-into-ssa.cc b/gcc/tree-into-ssa.cc
index be71b629f97..d13fb720b37 100644
--- a/gcc/tree-into-ssa.cc
+++ b/gcc/tree-into-ssa.cc
@@ -3451,11 +3451,13 @@ update_ssa (unsigned update_flags)
     phis_to_rewrite.create (last_basic_block_for_fn (cfun) + 1);
   blocks_to_update = BITMAP_ALLOC (NULL);
 
-  /* Ensure that the dominance information is up-to-date.  */
-  calculate_dominance_info (CDI_DOMINATORS);
-
   insert_phi_p = (update_flags != TODO_update_ssa_no_phi);
 
+  /* Ensure that the dominance information is up-to-date and when we
+     are going to compute dominance frontiers fast queries are possible.  */
+  if (insert_phi_p || dom_info_state (CDI_DOMINATORS) == DOM_NONE)
+    calculate_dominance_info (CDI_DOMINATORS);
+
   /* If there are names defined in the replacement table, prepare
      definition and use sites for all the names in NEW_SSA_NAMES and
      OLD_SSA_NAMES.  */


                 reply	other threads:[~2022-07-11 11:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220711114831.A0D9D385C320@sourceware.org \
    --to=rguenth@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).