summaryrefslogtreecommitdiff
path: root/gcc/sese.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2016-04-17 06:42:12 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2016-04-17 06:42:12 +0000
commitbd356bb6d247b18723734d4d1d0b32191cfb1a9a (patch)
tree1882cabb94561f964beaa242d722700c4239ab25 /gcc/sese.c
parentc8aed844acdc89884d630c7e3266ecd8d4101847 (diff)
downloadgcc-bd356bb6d247b18723734d4d1d0b32191cfb1a9a.tar.gz
2016-04-17 Basile Starynkevitch <basile@starynkevitch.net>
{{merging with even more of GCC 6, using subversion 1.9 svn merge -r232606:233050 ^/trunk }} [gcc/] 2016-04-17 Basile Starynkevitch <basile@starynkevitch.net> * melt/libmelt-ana-gimple.melt: (gimple_transaction): Use gimple_transaction_label_norm. Not sure that (gccif "6." ...) does what it should... git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@235078 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sese.c')
-rw-r--r--gcc/sese.c92
1 files changed, 38 insertions, 54 deletions
diff --git a/gcc/sese.c b/gcc/sese.c
index 59d2770f6f5..08ea47d010d 100644
--- a/gcc/sese.c
+++ b/gcc/sese.c
@@ -43,56 +43,6 @@ along with GCC; see the file COPYING3. If not see
#include "sese.h"
#include "tree-ssa-propagate.h"
-/* Record LOOP as occurring in REGION. */
-
-static void
-sese_record_loop (sese_info_p region, loop_p loop)
-{
- if (sese_contains_loop (region, loop))
- return;
-
- bitmap_set_bit (region->loops, loop->num);
- region->loop_nest.safe_push (loop);
-}
-
-/* Build the loop nests contained in REGION. Returns true when the
- operation was successful. */
-
-void
-build_sese_loop_nests (sese_info_p region)
-{
- unsigned i;
- basic_block bb;
- struct loop *loop0, *loop1;
-
- FOR_EACH_BB_FN (bb, cfun)
- if (bb_in_sese_p (bb, region->region))
- {
- struct loop *loop = bb->loop_father;
-
- /* Only add loops if they are completely contained in the SCoP. */
- if (loop->header == bb
- && bb_in_sese_p (loop->latch, region->region))
- sese_record_loop (region, loop);
- }
-
- /* Make sure that the loops in the SESE_LOOP_NEST are ordered. It
- can be the case that an inner loop is inserted before an outer
- loop. To avoid this, semi-sort once. */
- FOR_EACH_VEC_ELT (region->loop_nest, i, loop0)
- {
- if (region->loop_nest.length () == i + 1)
- break;
-
- loop1 = region->loop_nest[i + 1];
- if (loop0->num > loop1->num)
- {
- region->loop_nest[i] = loop1;
- region->loop_nest[i + 1] = loop0;
- }
- }
-}
-
/* For a USE in BB, if BB is outside REGION, mark the USE in the
LIVEOUTS set. */
@@ -228,14 +178,15 @@ new_sese_info (edge entry, edge exit)
region->region.entry = entry;
region->region.exit = exit;
- region->loops = BITMAP_ALLOC (NULL);
region->loop_nest.create (3);
region->params.create (3);
region->rename_map = new rename_map_t;
+ region->parameter_rename_map = new parameter_rename_map_t;
region->copied_bb_map = new bb_map_t;
region->bbs.create (3);
region->incomplete_phis.create (3);
+
return region;
}
@@ -244,9 +195,6 @@ new_sese_info (edge entry, edge exit)
void
free_sese_info (sese_info_p region)
{
- if (region->loops)
- region->loops = BITMAP_ALLOC (NULL);
-
region->params.release ();
region->loop_nest.release ();
@@ -259,9 +207,11 @@ free_sese_info (sese_info_p region)
(*it).second.release ();
delete region->rename_map;
+ delete region->parameter_rename_map;
delete region->copied_bb_map;
region->rename_map = NULL;
+ region->parameter_rename_map = NULL;
region->copied_bb_map = NULL;
region->bbs.release ();
@@ -635,3 +585,37 @@ scalar_evolution_in_region (const sese_l &region, loop_p loop, tree t)
return instantiate_scev (before, loop, t);
}
+
+/* Pretty print edge E to FILE. */
+
+void
+print_edge (FILE *file, const_edge e)
+{
+ fprintf (file, "edge (bb_%d, bb_%d)", e->src->index, e->dest->index);
+}
+
+/* Pretty print sese S to FILE. */
+
+void
+print_sese (FILE *file, const sese_l &s)
+{
+ fprintf (file, "(entry_"); print_edge (file, s.entry);
+ fprintf (file, ", exit_"); print_edge (file, s.exit);
+ fprintf (file, ")\n");
+}
+
+/* Pretty print edge E to STDERR. */
+
+DEBUG_FUNCTION void
+debug_edge (const_edge e)
+{
+ print_edge (stderr, e);
+}
+
+/* Pretty print sese S to STDERR. */
+
+DEBUG_FUNCTION void
+debug_sese (const sese_l &s)
+{
+ print_sese (stderr, s);
+}