Patchwork [49/65] Add loop_exits_from_bb_p.

login
register
mail settings
Submitter Sebastian Pop
Date Aug. 2, 2010, 8:20 p.m.
Message ID <1280780438-17543-50-git-send-email-sebpop@gmail.com>
Download mbox | patch
Permalink /patch/60647/
State New
Headers show

Comments

Sebastian Pop - Aug. 2, 2010, 8:20 p.m.
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>

2010-07-20  Vladimir Kargov  <kargov@gmail.com>
	    Sebastian Pop  <sebastian.pop@amd.com>

	* cfgloop.c (is_loop_exit): Renamed loop_exits_to_bb_p.
	(loop_exits_from_bb_p): New.
	* cfgloop.h (is_loop_exit): Renamed loop_exits_to_bb_p.
	(loop_exits_from_bb_p): Declared.
	* graphite-scop-detection.c (scopdet_basic_block_info): Call
	loop_exits_to_bb_p.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162353 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog                 |   10 ++++++++++
 gcc/ChangeLog.graphite        |   10 ++++++++++
 gcc/cfgloop.c                 |   19 +++++++++++++++++--
 gcc/cfgloop.h                 |    3 ++-
 gcc/graphite-scop-detection.c |    2 +-
 5 files changed, 40 insertions(+), 4 deletions(-)

Patch

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1fa3f50..7064ecc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@ 
+2010-08-02  Vladimir Kargov  <kargov@gmail.com>
+	    Sebastian Pop  <sebastian.pop@amd.com>
+
+	* cfgloop.c (is_loop_exit): Renamed loop_exits_to_bb_p.
+	(loop_exits_from_bb_p): New.
+	* cfgloop.h (is_loop_exit): Renamed loop_exits_to_bb_p.
+	(loop_exits_from_bb_p): Declared.
+	* graphite-scop-detection.c (scopdet_basic_block_info): Call
+	loop_exits_to_bb_p.
+
 2010-08-02  Sebastian Pop  <sebastian.pop@amd.com>
 
 	* graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Add an
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index e4d59ce..96034ad 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,4 +1,14 @@ 
 2010-07-20  Vladimir Kargov  <kargov@gmail.com>
+	    Sebastian Pop  <sebastian.pop@amd.com>
+
+	* cfgloop.c (is_loop_exit): Renamed loop_exits_to_bb_p.
+	(loop_exits_from_bb_p): New.
+	* cfgloop.h (is_loop_exit): Renamed loop_exits_to_bb_p.
+	(loop_exits_from_bb_p): Declared.
+	* graphite-scop-detection.c (scopdet_basic_block_info): Call
+	loop_exits_to_bb_p.
+
+2010-07-20  Vladimir Kargov  <kargov@gmail.com>
 
 	* refined-regions.c: Include tree-pass.h, cfgloop.h, gimple.h, and
 	tree-data-ref.h.
diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c
index 24f0ebc..d114563 100644
--- a/gcc/cfgloop.c
+++ b/gcc/cfgloop.c
@@ -1620,10 +1620,10 @@  single_exit (const struct loop *loop)
     return NULL;
 }
 
-/* Returns true when BB has an edge exiting LOOP.  */
+/* Returns true when BB has an incoming edge exiting LOOP.  */
 
 bool
-is_loop_exit (struct loop *loop, basic_block bb)
+loop_exits_to_bb_p (struct loop *loop, basic_block bb)
 {
   edge e;
   edge_iterator ei;
@@ -1634,3 +1634,18 @@  is_loop_exit (struct loop *loop, basic_block bb)
 
   return false;
 }
+
+/* Returns true when BB has an outgoing edge exiting LOOP.  */
+
+bool
+loop_exits_from_bb_p (struct loop *loop, basic_block bb)
+{
+  edge e;
+  edge_iterator ei;
+
+  FOR_EACH_EDGE (e, ei, bb->succs)
+    if (loop_exit_edge_p (loop, e))
+      return true;
+
+  return false;
+}
diff --git a/gcc/cfgloop.h b/gcc/cfgloop.h
index 1f0e3ca..722aa33 100644
--- a/gcc/cfgloop.h
+++ b/gcc/cfgloop.h
@@ -232,7 +232,8 @@  extern int num_loop_insns (const struct loop *);
 extern int average_num_loop_insns (const struct loop *);
 extern unsigned get_loop_level (const struct loop *);
 extern bool loop_exit_edge_p (const struct loop *, const_edge);
-extern bool is_loop_exit (struct loop *, basic_block);
+extern bool loop_exits_to_bb_p (struct loop *, basic_block);
+extern bool loop_exits_from_bb_p (struct loop *, basic_block);
 extern void mark_loop_exit_edges (void);
 
 /* Loops & cfg manipulation.  */
diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c
index baa4c34..07d94d0 100644
--- a/gcc/graphite-scop-detection.c
+++ b/gcc/graphite-scop-detection.c
@@ -594,7 +594,7 @@  scopdet_basic_block_info (basic_block bb, loop_p outermost_loop,
 	  {
 	    /* Ignore loop exits.  They will be handled after the loop
 	       body.  */
-	    if (is_loop_exit (loop, e->dest))
+	    if (loop_exits_to_bb_p (loop, e->dest))
 	      {
 		result.exits = true;
 		continue;