Remove individial dependence pointers and add a scop::dependence to contain all the...
authorspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 16 Dec 2015 17:33:07 +0000 (17:33 +0000)
committerspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 16 Dec 2015 17:33:07 +0000 (17:33 +0000)
Removed the member variables which are only used in scop_get_dependence. Instead
only maintaining the overall dependence. Passes regtest and bootstrap.

gcc/ChangeLog:

2015-12-15  hiraditya  <hiraditya@msn.com>

        * graphite-dependences.c (scop_get_dependences): Use local pointers.
        * graphite-isl-ast-to-gimple.c(translate_isl_ast_to_gimple::scop_to_isl_ast):
          Use scop->dependence.
        * graphite-optimize-isl.c (optimize_isl): Same.
        * graphite-poly.c (new_scop): Remove initialization of removed members.
        (free_scop): Same.
        * graphite.h (struct scop): Remove individial dependence pointers and
        add a scop::dependence to contain all the dependence.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231708 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/graphite-dependences.c
gcc/graphite-isl-ast-to-gimple.c
gcc/graphite-optimize-isl.c
gcc/graphite-poly.c
gcc/graphite.h

index 2ee6de9..08641b7 100644 (file)
@@ -1,4 +1,15 @@
 2015-12-16  Aditya Kumar  <aditya.k7@samsung.com>
+
+       * graphite-dependences.c (scop_get_dependences): Use local pointers.
+       * graphite-isl-ast-to-gimple.c
+       (translate_isl_ast_to_gimple::scop_to_isl_ast): Use scop->dependence.
+       * graphite-optimize-isl.c (optimize_isl): Same.
+       * graphite-poly.c (new_scop): Remove initialization of removed members.
+       (free_scop): Same.
+       * graphite.h (struct scop): Remove individial dependence pointers and
+       add a scop::dependence to contain all the dependence.
+
+2015-12-16  Aditya Kumar  <aditya.k7@samsung.com>
            Sebastian Pop  <s.pop@samsung.com>
 
        * config.in: Regenerate.
index 7b7912a..407a11e 100644 (file)
@@ -399,28 +399,32 @@ compute_deps (scop_p scop, vec<poly_bb_p> pbbs,
 isl_union_map *
 scop_get_dependences (scop_p scop)
 {
-  isl_union_map *dependences;
-
-  if (!scop->must_raw)
-    compute_deps (scop, scop->pbbs,
-                 &scop->must_raw, &scop->may_raw,
-                 &scop->must_raw_no_source, &scop->may_raw_no_source,
-                 &scop->must_war, &scop->may_war,
-                 &scop->must_war_no_source, &scop->may_war_no_source,
-                 &scop->must_waw, &scop->may_waw,
-                 &scop->must_waw_no_source, &scop->may_waw_no_source);
-
-  dependences = isl_union_map_copy (scop->must_raw);
-  dependences = isl_union_map_union (dependences,
-                                    isl_union_map_copy (scop->must_war));
-  dependences = isl_union_map_union (dependences,
-                                    isl_union_map_copy (scop->must_waw));
-  dependences = isl_union_map_union (dependences,
-                                    isl_union_map_copy (scop->may_raw));
-  dependences = isl_union_map_union (dependences,
-                                    isl_union_map_copy (scop->may_war));
-  dependences = isl_union_map_union (dependences,
-                                    isl_union_map_copy (scop->may_waw));
+  if (scop->dependence)
+    return scop->dependence;
+
+  /* The original dependence relations:
+     RAW are read after write dependences,
+     WAR are write after read dependences,
+     WAW are write after write dependences.  */
+  isl_union_map *must_raw = NULL, *may_raw = NULL, *must_raw_no_source = NULL,
+      *may_raw_no_source = NULL, *must_war = NULL, *may_war = NULL,
+      *must_war_no_source = NULL, *may_war_no_source = NULL, *must_waw = NULL,
+      *may_waw = NULL, *must_waw_no_source = NULL, *may_waw_no_source = NULL;
+
+  compute_deps (scop, scop->pbbs,
+                 &must_raw, &may_raw,
+                 &must_raw_no_source, &may_raw_no_source,
+                 &must_war, &may_war,
+                 &must_war_no_source, &may_war_no_source,
+                 &must_waw, &may_waw,
+                 &must_waw_no_source, &may_waw_no_source);
+
+  isl_union_map *dependences = must_raw;
+  dependences = isl_union_map_union (dependences, must_war);
+  dependences = isl_union_map_union (dependences, must_waw);
+  dependences = isl_union_map_union (dependences, may_raw);
+  dependences = isl_union_map_union (dependences, may_war);
+  dependences = isl_union_map_union (dependences, may_waw);
 
   if (dump_file)
     {
@@ -429,6 +433,14 @@ scop_get_dependences (scop_p scop)
       fprintf (dump_file, ")\n");
     }
 
+  isl_union_map_free (must_raw_no_source);
+  isl_union_map_free (may_raw_no_source);
+  isl_union_map_free (must_war_no_source);
+  isl_union_map_free (may_war_no_source);
+  isl_union_map_free (must_waw_no_source);
+  isl_union_map_free (may_waw_no_source);
+
+  scop->dependence = dependences;
   return dependences;
 }
 
index 2f04de5..b392766 100644 (file)
@@ -3197,18 +3197,15 @@ translate_isl_ast_to_gimple::scop_to_isl_ast (scop_p scop, ivs_params &ip)
   isl_union_map *schedule_isl = generate_isl_schedule (scop);
   isl_ast_build *context_isl = generate_isl_context (scop);
   context_isl = set_options (context_isl, schedule_isl);
-  isl_union_map *dependences = NULL;
   if (flag_loop_parallelize_all)
     {
-      dependences = scop_get_dependences (scop);
+      isl_union_map *dependence = scop_get_dependences (scop);
       context_isl =
        isl_ast_build_set_before_each_for (context_isl, ast_build_before_for,
-                                          dependences);
+                                          dependence);
     }
   isl_ast_node *ast_isl = isl_ast_build_ast_from_schedule (context_isl,
                                                           schedule_isl);
-  if (dependences)
-    isl_union_map_free (dependences);
   isl_ast_build_free (context_isl);
   return ast_isl;
 }
index a8955f9..f5cb5c4 100644 (file)
@@ -380,12 +380,12 @@ optimize_isl (scop_p scop)
   isl_options_set_on_error (scop->isl_context, ISL_ON_ERROR_CONTINUE);
 
   isl_union_set *domain = scop_get_domains (scop);
-  isl_union_map *dependences = scop_get_dependences (scop);
-  dependences
-    = isl_union_map_gist_domain (dependences, isl_union_set_copy (domain));
-  dependences
-    = isl_union_map_gist_range (dependences, isl_union_set_copy (domain));
-  isl_union_map *validity = dependences;
+  scop_get_dependences (scop);
+  scop->dependence
+    = isl_union_map_gist_domain (scop->dependence, isl_union_set_copy (domain));
+  scop->dependence
+    = isl_union_map_gist_range (scop->dependence, isl_union_set_copy (domain));
+  isl_union_map *validity = isl_union_map_copy (scop->dependence);
   isl_union_map *proximity = isl_union_map_copy (validity);
 
   isl_options_set_schedule_max_constant_term (scop->isl_context, CONSTANT_BOUND);
index 44f0241..00d674c 100644 (file)
@@ -295,26 +295,15 @@ scop_p
 new_scop (edge entry, edge exit)
 {
   sese_info_p region = new_sese_info (entry, exit);
-  scop_p scop = XNEW (struct scop);
-
-  scop->param_context = NULL;
-  scop->must_raw = NULL;
-  scop->may_raw = NULL;
-  scop->must_raw_no_source = NULL;
-  scop->may_raw_no_source = NULL;
-  scop->must_war = NULL;
-  scop->may_war = NULL;
-  scop->must_war_no_source = NULL;
-  scop->may_war_no_source = NULL;
-  scop->must_waw = NULL;
-  scop->may_waw = NULL;
-  scop->must_waw_no_source = NULL;
-  scop->may_waw_no_source = NULL;
-  scop_set_region (scop, region);
-  scop->pbbs.create (3);
-  scop->drs.create (3);
-
-  return scop;
+  scop_p s;
+  s = XNEW (struct scop);
+
+  s->param_context = NULL;
+  scop_set_region (s, region);
+  s->pbbs.create (3);
+  s->drs.create (3);
+  s->dependence = NULL;
+  return s;
 }
 
 /* Deletes SCOP.  */
@@ -335,18 +324,8 @@ free_scop (scop_p scop)
   scop->drs.release ();
 
   isl_set_free (scop->param_context);
-  isl_union_map_free (scop->must_raw);
-  isl_union_map_free (scop->may_raw);
-  isl_union_map_free (scop->must_raw_no_source);
-  isl_union_map_free (scop->may_raw_no_source);
-  isl_union_map_free (scop->must_war);
-  isl_union_map_free (scop->may_war);
-  isl_union_map_free (scop->must_war_no_source);
-  isl_union_map_free (scop->may_war_no_source);
-  isl_union_map_free (scop->must_waw);
-  isl_union_map_free (scop->may_waw);
-  isl_union_map_free (scop->must_waw_no_source);
-  isl_union_map_free (scop->may_waw_no_source);
+  isl_union_map_free (scop->dependence);
+  scop->dependence = NULL;
   XDELETE (scop);
 }
 
index 099e410..ba91dfa 100644 (file)
@@ -411,13 +411,8 @@ struct scop
   /* The context used internally by ISL.  */
   isl_ctx *isl_context;
 
-  /* The original dependence relations:
-     RAW are read after write dependences,
-     WAR are write after read dependences,
-     WAW are write after write dependences.  */
-  isl_union_map *must_raw, *may_raw, *must_raw_no_source, *may_raw_no_source,
-    *must_war, *may_war, *must_war_no_source, *may_war_no_source,
-    *must_waw, *may_waw, *must_waw_no_source, *may_waw_no_source;
+  /* The data dependence relation among the data references in this scop.  */
+  isl_union_map *dependence;
 };
 
 extern scop_p new_scop (edge, edge);