@@ -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.
@@ -1622,10 +1622,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;
@@ -1636,3 +1636,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;
+}
@@ -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. */
@@ -595,7 +595,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;