public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Aldy Hernandez <aldyh@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-5526] path solver: Revert computation of ranges in gimple order.
Date: Thu, 25 Nov 2021 16:34:50 +0000 (GMT)	[thread overview]
Message-ID: <20211125163450.D1A303858D35@sourceware.org> (raw)

https://gcc.gnu.org/g:415f9ee404dc9e8ae1cade160a33400b10abb18a

commit r12-5526-g415f9ee404dc9e8ae1cade160a33400b10abb18a
Author: Aldy Hernandez <aldyh@redhat.com>
Date:   Thu Nov 25 17:30:07 2021 +0100

    path solver: Revert computation of ranges in gimple order.
    
    Revert the patch below, as it may slow down compilation with large CFGs.
    
            commit 8acbd7bef6edbf537e3037174907029b530212f6
            Author: Aldy Hernandez <aldyh@redhat.com>
            Date:   Wed Nov 24 09:43:36 2021 +0100
    
                path solver: Compute ranges in path in gimple order.
    
    gcc/ChangeLog:
    
            * gimple-range-path.cc (path_range_query::compute_ranges_defined): Remove.
            (path_range_query::compute_ranges_in_block): Revert to bitmap order.
            * gimple-range-path.h: Remove compute_ranges_defined.

Diff:
---
 gcc/gimple-range-path.cc | 33 +++++++++++----------------------
 gcc/gimple-range-path.h  |  1 -
 2 files changed, 11 insertions(+), 23 deletions(-)

diff --git a/gcc/gimple-range-path.cc b/gcc/gimple-range-path.cc
index 806bce9ff11..b9c71226c1c 100644
--- a/gcc/gimple-range-path.cc
+++ b/gcc/gimple-range-path.cc
@@ -401,27 +401,6 @@ path_range_query::compute_ranges_in_phis (basic_block bb)
     }
 }
 
-// Compute ranges defined in block.
-
-void
-path_range_query::compute_ranges_defined (basic_block bb)
-{
-  int_range_max r;
-
-  compute_ranges_in_phis (bb);
-
-  // Iterate in gimple order to minimize recursion.
-  for (auto gsi = gsi_start_nondebug_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
-    if (gimple_has_lhs (gsi_stmt (gsi)))
-      {
-	tree name = gimple_get_lhs (gsi_stmt (gsi));
-	if (TREE_CODE (name) == SSA_NAME
-	    && bitmap_bit_p (m_imports, SSA_NAME_VERSION (name))
-	    && range_defined_in_block (r, name, bb))
-	  set_cache (r, name);
-      }
-}
-
 // Compute ranges defined in the current block, or exported to the
 // next block.
 
@@ -444,7 +423,17 @@ path_range_query::compute_ranges_in_block (basic_block bb)
 	clear_cache (name);
     }
 
-  compute_ranges_defined (bb);
+  // Solve imports defined in this block, starting with the PHIs...
+  compute_ranges_in_phis (bb);
+  // ...and then the rest of the imports.
+  EXECUTE_IF_SET_IN_BITMAP (m_imports, 0, i, bi)
+    {
+      tree name = ssa_name (i);
+
+      if (gimple_code (SSA_NAME_DEF_STMT (name)) != GIMPLE_PHI
+	  && range_defined_in_block (r, name, bb))
+	set_cache (r, name);
+    }
 
   if (at_exit ())
     return;
diff --git a/gcc/gimple-range-path.h b/gcc/gimple-range-path.h
index 81c87d475dd..57a9ae9bdcd 100644
--- a/gcc/gimple-range-path.h
+++ b/gcc/gimple-range-path.h
@@ -58,7 +58,6 @@ private:
   // Methods to compute ranges for the given path.
   bool range_defined_in_block (irange &, tree name, basic_block bb);
   void compute_ranges_in_block (basic_block bb);
-  void compute_ranges_defined (basic_block bb);
   void compute_ranges_in_phis (basic_block bb);
   void adjust_for_non_null_uses (basic_block bb);
   void ssa_range_in_phi (irange &r, gphi *phi);


                 reply	other threads:[~2021-11-25 16:34 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=20211125163450.D1A303858D35@sourceware.org \
    --to=aldyh@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).