public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Aldy Hernandez <aldyh@redhat.com>
To: Andrew MacLeod <amacleod@redhat.com>
Cc: GCC patches <gcc-patches@gcc.gnu.org>, Aldy Hernandez <aldyh@redhat.com>
Subject: [COMMITTED] path solver: Avoid further lookups when range is defined in block.
Date: Fri, 24 Sep 2021 16:50:51 +0200	[thread overview]
Message-ID: <20210924145051.1100082-1-aldyh@redhat.com> (raw)

If an SSA is defined in the current block, there is no need to query
range_on_path_entry for additional information.

Tested on x86-64 Linux.

gcc/ChangeLog:

	* gimple-range-path.cc (path_range_query::path_range_query):
	Move debugging header...
	(path_range_query::precompute_ranges): ...here.
	(path_range_query::internal_range_of_expr): Do not call
	range_on_path_entry if NAME is defined in the current block.
---
 gcc/gimple-range-path.cc | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/gcc/gimple-range-path.cc b/gcc/gimple-range-path.cc
index d9704c8f86b..0738a5ca159 100644
--- a/gcc/gimple-range-path.cc
+++ b/gcc/gimple-range-path.cc
@@ -39,9 +39,6 @@ along with GCC; see the file COPYING3.  If not see
 path_range_query::path_range_query (gimple_ranger &ranger, bool resolve)
   : m_ranger (ranger)
 {
-  if (DEBUG_SOLVER)
-    fprintf (dump_file, "\n*********** path_range_query ******************\n");
-
   m_cache = new ssa_global_cache;
   m_has_cache_entry = BITMAP_ALLOC (NULL);
   m_path = NULL;
@@ -173,9 +170,6 @@ path_range_query::internal_range_of_expr (irange &r, tree name, gimple *stmt)
       if (TREE_CODE (name) == SSA_NAME)
 	r.intersect (gimple_range_global (name));
 
-      if (m_resolve && r.varying_p ())
-	range_on_path_entry (r, name);
-
       set_cache (r, name);
       return true;
     }
@@ -467,6 +461,9 @@ void
 path_range_query::precompute_ranges (const vec<basic_block> &path,
 				     const bitmap_head *imports)
 {
+  if (DEBUG_SOLVER)
+    fprintf (dump_file, "\n*********** path_range_query ******************\n");
+
   set_path (path);
   bitmap_copy (m_imports, imports);
   m_undefined_path = false;
-- 
2.31.1


                 reply	other threads:[~2021-09-24 14:51 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=20210924145051.1100082-1-aldyh@redhat.com \
    --to=aldyh@redhat.com \
    --cc=amacleod@redhat.com \
    --cc=gcc-patches@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).