public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/aldyh/heads/ranger-relational)] make recompute check explicit and seperate.
@ 2021-04-16 13:25 Andrew Macleod
  0 siblings, 0 replies; only message in thread
From: Andrew Macleod @ 2021-04-16 13:25 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:986d54e68130af7dd166722514aa99f3e5f16a0c

commit 986d54e68130af7dd166722514aa99f3e5f16a0c
Author: Andrew MacLeod <amacleod@redhat.com>
Date:   Thu Apr 15 18:40:53 2021 -0400

    make recompute check explicit and seperate.

Diff:
---
 gcc/gimple-range-gori.cc | 49 +++++++++++++++++++++---------------------------
 gcc/gimple-range-gori.h  |  1 +
 2 files changed, 22 insertions(+), 28 deletions(-)

diff --git a/gcc/gimple-range-gori.cc b/gcc/gimple-range-gori.cc
index 545f0a16059..dfeb3335e47 100644
--- a/gcc/gimple-range-gori.cc
+++ b/gcc/gimple-range-gori.cc
@@ -979,33 +979,34 @@ gori_compute::compute_logical_operands (irange &true_range, irange &false_range,
 }
 
 
-// Return TRUE if a range can be calcalated for NAME on edge E.
+// Return TRUE if NAME can be recomputed on edge E.
 
 bool
-gori_compute::has_edge_range_p (tree name, edge e)
+gori_compute::may_recompute_p (tree name, edge e)
 {
   tree dep1 = depend1 (name);
   tree dep2 = depend2 (name);
 
-  // If no edge is specified, check if NAME is an export on any edge.
-  if (!e)
-    {
-      if (is_export_p (name) || (dep1 && is_export_p (dep1))
-	  || (dep2 && is_export_p (dep2)))
-	return true;
-      return false;
-    }
+  // If edge is specified, check if NAME can be recalculated on that edge.
+  if (e)
+    return ((dep1 && is_export_p (dep1, e->src))
+	    || (dep2 && is_export_p (dep2, e->src)));
 
-  if (is_export_p (name, e->src)
-      || def_chain_in_bitmap_p (name, exports (e->src)))
-    return true;
+  return (dep1 && is_export_p (dep1)) || (dep2 && is_export_p (dep2));
+}
 
-  if (dep1 && is_export_p (dep1, e->src))
-    return true;
-  if (dep2 && is_export_p (dep2, e->src))
-    return true;
 
-  return false;
+// Return TRUE if a range can be calcalated for NAME on edge E.
+
+bool
+gori_compute::has_edge_range_p (tree name, edge e)
+{
+
+  // If edge is specified, check if NAME is an export or recalc on that edge.
+  if (e)
+    return is_export_p (name, e->src) || may_recompute_p (name, e);
+  return is_export_p (name) || may_recompute_p (name);
+
 }
 
 bool
@@ -1088,16 +1089,8 @@ gori_compute::outgoing_edge_range_p (irange &r, edge e, tree name,
 	}
     }
 
-  if (recalc)
-    {
-      // If any direct dependencies are exported from this block, try to
-      // recompute the result using those values..
-      tree dep1 = depend1 (name);
-      tree dep2 = depend2 (name);
-      if ((dep1 && is_export_p (dep1, e->src))
-	  || (dep2 && is_export_p (dep2, e->src)))
-	return recompute (r, e, name);
-    }
+  if (recalc && may_recompute_p (name, e))
+    return recompute (r, e, name);
 
   return false;
 }
diff --git a/gcc/gimple-range-gori.h b/gcc/gimple-range-gori.h
index 83f8806f9fd..41c48819b4c 100644
--- a/gcc/gimple-range-gori.h
+++ b/gcc/gimple-range-gori.h
@@ -150,6 +150,7 @@ public:
   bool has_edge_range_p (tree name, edge e = NULL);
   void dump (FILE *f);
 protected:
+  bool may_recompute_p (tree name, edge e = NULL);
   virtual void ssa_range_in_bb (irange &r, tree name, basic_block bb);
   virtual bool compute_operand_range (irange &r, gimple *stmt,
 				      const irange &lhs, tree name,


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

only message in thread, other threads:[~2021-04-16 13:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-16 13:25 [gcc(refs/users/aldyh/heads/ranger-relational)] make recompute check explicit and seperate Andrew Macleod

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