public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-5515] path solver: Move boolean import code to compute_imports.
@ 2021-11-25 10:55 Aldy Hernandez
  0 siblings, 0 replies; only message in thread
From: Aldy Hernandez @ 2021-11-25 10:55 UTC (permalink / raw)
  To: gcc-cvs

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

commit r12-5515-gd1c1919ef8a18eea9d5c1741f8c9adaabf5571f2
Author: Aldy Hernandez <aldyh@redhat.com>
Date:   Wed Nov 24 17:58:43 2021 +0100

    path solver: Move boolean import code to compute_imports.
    
    In a follow-up patch I will be pruning the set of exported ranges
    within blocks to avoid unnecessary work.  In order to do this, all the
    interesting SSA names must be in the internal import bitmap ahead of
    time.  I had already abstracted them out into compute_imports, but I
    missed the boolean code.  This fixes the oversight.
    
    There's a net gain of 25 threadable paths, which is unexpected but
    welcome.
    
    Tested on x86-64 & ppc64le Linux.
    
    gcc/ChangeLog:
    
            PR tree-optimization/103254
            * gimple-range-path.cc (path_range_query::compute_ranges): Move
            exported boolean code...
            (path_range_query::compute_imports): ...here.

Diff:
---
 gcc/gimple-range-path.cc | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/gcc/gimple-range-path.cc b/gcc/gimple-range-path.cc
index e24086691c4..806bce9ff11 100644
--- a/gcc/gimple-range-path.cc
+++ b/gcc/gimple-range-path.cc
@@ -537,7 +537,8 @@ void
 path_range_query::compute_imports (bitmap imports, basic_block exit)
 {
   // Start with the imports from the exit block...
-  bitmap r_imports = m_ranger->gori ().imports (exit);
+  gori_compute &gori = m_ranger->gori ();
+  bitmap r_imports = gori.imports (exit);
   bitmap_copy (imports, r_imports);
 
   auto_vec<tree> worklist (bitmap_count_bits (imports));
@@ -579,6 +580,16 @@ path_range_query::compute_imports (bitmap imports, basic_block exit)
 	    }
 	}
     }
+  // Exported booleans along the path, may help conditionals.
+  if (m_resolve)
+    for (i = 0; i < m_path.length (); ++i)
+      {
+	basic_block bb = m_path[i];
+	tree name;
+	FOR_EACH_GORI_EXPORT_NAME (gori, bb, name)
+	  if (TREE_CODE (TREE_TYPE (name)) == BOOLEAN_TYPE)
+	    bitmap_set_bit (imports, SSA_NAME_VERSION (name));
+      }
 }
 
 // Compute the ranges for IMPORTS along PATH.
@@ -622,18 +633,6 @@ path_range_query::compute_ranges (const vec<basic_block> &path,
     {
       basic_block bb = curr_bb ();
 
-      if (m_resolve)
-	{
-	  gori_compute &gori = m_ranger->gori ();
-	  tree name;
-
-	  // Exported booleans along the path, may help conditionals.
-	  // Add them as interesting imports.
-	  FOR_EACH_GORI_EXPORT_NAME (gori, bb, name)
-	    if (TREE_CODE (TREE_TYPE (name)) == BOOLEAN_TYPE)
-	      bitmap_set_bit (m_imports, SSA_NAME_VERSION (name));
-	}
-
       compute_ranges_in_block (bb);
       adjust_for_non_null_uses (bb);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-25 10:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-25 10:55 [gcc r12-5515] path solver: Move boolean import code to compute_imports Aldy Hernandez

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).