summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/graphite-dependences.c56
-rw-r--r--gcc/graphite-isl-ast-to-gimple.c7
-rw-r--r--gcc/graphite-optimize-isl.c12
-rw-r--r--gcc/graphite-poly.c43
-rw-r--r--gcc/graphite.h9
6 files changed, 66 insertions, 72 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2ee6de9a94a..08641b7c0f3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/graphite-dependences.c b/gcc/graphite-dependences.c
index 7b7912ac503..407a11e3c1b 100644
--- a/gcc/graphite-dependences.c
+++ b/gcc/graphite-dependences.c
@@ -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;
}
diff --git a/gcc/graphite-isl-ast-to-gimple.c b/gcc/graphite-isl-ast-to-gimple.c
index 2f04de52c4a..b392766a27f 100644
--- a/gcc/graphite-isl-ast-to-gimple.c
+++ b/gcc/graphite-isl-ast-to-gimple.c
@@ -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;
}
diff --git a/gcc/graphite-optimize-isl.c b/gcc/graphite-optimize-isl.c
index a8955f925e8..f5cb5c45dcc 100644
--- a/gcc/graphite-optimize-isl.c
+++ b/gcc/graphite-optimize-isl.c
@@ -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);
diff --git a/gcc/graphite-poly.c b/gcc/graphite-poly.c
index 44f02416586..00d674cd7c9 100644
--- a/gcc/graphite-poly.c
+++ b/gcc/graphite-poly.c
@@ -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);
}
diff --git a/gcc/graphite.h b/gcc/graphite.h
index 099e4108d35..ba91dfa4d25 100644
--- a/gcc/graphite.h
+++ b/gcc/graphite.h
@@ -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);