aboutsummaryrefslogtreecommitdiff
path: root/gcc/graphite-dependences.c
diff options
context:
space:
mode:
authorAditya Kumar <aditya.k7@samsung.com>2015-12-16 17:33:07 +0000
committerSebastian Pop <spop@gcc.gnu.org>2015-12-16 17:33:07 +0000
commit0f7a02a32f887d944a760004927518d903bb4443 (patch)
tree9c0e606157f927a48dd88bedb966bb39208877e1 /gcc/graphite-dependences.c
parent0ddb9c8d784858c4c80b7c93762e0e9d7e8b5a3a (diff)
downloadgcc-0f7a02a32f887d944a760004927518d903bb4443.zip
gcc-0f7a02a32f887d944a760004927518d903bb4443.tar.gz
gcc-0f7a02a32f887d944a760004927518d903bb4443.tar.bz2
Remove individial dependence pointers and add a scop::dependence to contain all the dependence.
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. From-SVN: r231708
Diffstat (limited to 'gcc/graphite-dependences.c')
-rw-r--r--gcc/graphite-dependences.c56
1 files changed, 34 insertions, 22 deletions
diff --git a/gcc/graphite-dependences.c b/gcc/graphite-dependences.c
index 7b7912a..407a11e 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;
}