public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew MacLeod <amacleod@redhat.com>
To: gcc-patches <gcc-patches@gcc.gnu.org>
Cc: "hernandez, aldy" <aldyh@redhat.com>
Subject: [COMMITTED] Gori_on_edge tweaks.
Date: Tue, 28 May 2024 22:38:52 -0400	[thread overview]
Message-ID: <c432da72-5271-4591-a969-d570c3735549@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 381 bytes --]


FAST_VRP uses a non-ranger gori_on_edge routine to calculate the full 
set of SSA ranges that can be calculated on an edge.  It allows an 
optional  outgoing_edge_range object if one wanted to use switches.  
This is now integrated with the gori () method of a range_query, and is 
no longer needed.

Bootstrapped on x86_64-pc-linux-gnu with no regressions.  Pushed.

Andrew


[-- Attachment #2: 0004 --]
[-- Type: text/plain, Size: 3281 bytes --]

commit a19f588d0b71a4cbc48b064177de87d3ca46b39f
Author: Andrew MacLeod <amacleod@redhat.com>
Date:   Wed May 22 19:51:16 2024 -0400

    Gori_on_edge tweaks.
    
    FAST_VRP uses a non-ranger gori_on_edge routine which allows an optional
    outgoing_edge_range object if one wanted to use switches.  This is now
    integrated with the gori () method of a range_query, and is no longer
    needed.
    
            * gimple-range-gori.cc (gori_on_edge): Always use static ranges
            from the specified range_query.
            * gimple-range-gori.h (gori_on_edge): Change prototype.
            * gimple-range.cc (dom_ranger::maybe_push_edge): Change arguments
            to call.

diff --git a/gcc/gimple-range-gori.cc b/gcc/gimple-range-gori.cc
index 0d471b46903..d489aef312c 100644
--- a/gcc/gimple-range-gori.cc
+++ b/gcc/gimple-range-gori.cc
@@ -1625,28 +1625,20 @@ gori_calc_operands (vrange &lhs, gimple *stmt, ssa_cache &r, range_query *q)
 }
 
 // Use ssa_cache R as a repository for all outgoing ranges on edge E that
-// can be calculated.  Use OGR if present to establish starting edge ranges,
-// and Q to resolve operand values.  If Q is NULL use the current range
+// can be calculated.  Use Q to establish starting edge ranges anbd to resolve
+// operand values.  If Q is NULL use the current range
 // query available to the system.
 
 bool
-gori_on_edge (ssa_cache &r, edge e, range_query *q, gimple_outgoing_range *ogr)
+gori_on_edge (ssa_cache &r, edge e, range_query *q)
 {
+  if (!q)
+    q = get_range_query (cfun);
   // Start with an empty vector
   r.clear ();
   int_range_max lhs;
   // Determine if there is an outgoing edge.
-  gimple *stmt;
-  if (ogr)
-    stmt = ogr->edge_range_p (lhs, e);
-  else
-    {
-      stmt = gimple_outgoing_range_stmt_p (e->src);
-      if (stmt && is_a<gcond *> (stmt))
-	gcond_edge_range (lhs, e);
-      else
-	stmt = NULL;
-    }
+  gimple *stmt = q->gori ().edge_range_p (lhs, e);
   if (!stmt)
     return false;
   gori_calc_operands (lhs, stmt, r, q);
diff --git a/gcc/gimple-range-gori.h b/gcc/gimple-range-gori.h
index 9b4bcd919f5..11019e38471 100644
--- a/gcc/gimple-range-gori.h
+++ b/gcc/gimple-range-gori.h
@@ -213,10 +213,8 @@ private:
 // ssa_cache structure).
 // GORI_NAME_ON_EDGE  is used to simply ask if NAME has a range on edge E
 
-// Fill ssa-cache R with any outgoing ranges on edge E, using OGR and QUERY.
-bool gori_on_edge (class ssa_cache &r, edge e,
-		   range_query *query = NULL,
-		   gimple_outgoing_range *ogr = NULL);
+// Fill ssa-cache R with any outgoing ranges on edge E, using QUERY.
+bool gori_on_edge (class ssa_cache &r, edge e, range_query *query = NULL);
 
 // Query if NAME has an outgoing range on edge E, and return it in R if so.
 // Note this doesnt use ranger, its a static GORI analysis of the range in
diff --git a/gcc/gimple-range.cc b/gcc/gimple-range.cc
index 711646abb67..be22bb4aa18 100644
--- a/gcc/gimple-range.cc
+++ b/gcc/gimple-range.cc
@@ -1156,7 +1156,7 @@ dom_ranger::maybe_push_edge (edge e, bool edge_0)
     e_cache = m_freelist.pop ();
   else
     e_cache = new ssa_lazy_cache;
-  gori_on_edge (*e_cache, e, this, &gori ());
+  gori_on_edge (*e_cache, e, this);
   if (e_cache->empty_p ())
     m_freelist.safe_push (e_cache);
   else

                 reply	other threads:[~2024-05-29  2:38 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=c432da72-5271-4591-a969-d570c3735549@redhat.com \
    --to=amacleod@redhat.com \
    --cc=aldyh@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).