diff options
author | Roman Gareev <gareevroman@gmail.com> | 2014-08-05 03:41:29 +0000 |
---|---|---|
committer | Roman Gareev <romangareev@gcc.gnu.org> | 2014-08-05 03:41:29 +0000 |
commit | 574921c272ca69e7a224d5e45f287d9c2fd49530 (patch) | |
tree | 9a96a394ec62b7802faa234bd03fae43b9e630c8 /gcc/graphite-dependences.c | |
parent | b5975cebfbe3666fe53f98e88cfbe6933978895b (diff) | |
download | gcc-574921c272ca69e7a224d5e45f287d9c2fd49530.zip gcc-574921c272ca69e7a224d5e45f287d9c2fd49530.tar.gz gcc-574921c272ca69e7a224d5e45f287d9c2fd49530.tar.bz2 |
graphite-isl-ast-to-gimple.c: Add a new struct ast_build_info.
[gcc/]
* graphite-isl-ast-to-gimple.c: Add a new struct ast_build_info.
(translate_isl_ast_for_loop): Add checking of the
flag_loop_parallelize_all.
(ast_build_before_for): New function.
(scop_to_isl_ast): Add checking of the
flag_loop_parallelize_all.
* graphite-dependences.c: Move the defenition of the
scop_get_dependences from graphite-optimize-isl.c to this file.
(apply_schedule_on_deps): Add checking of the ux's emptiness.
(carries_deps): Add checking of the x's value.
* graphite-optimize-isl.c: Move the defenition of the
scop_get_dependences to graphite-dependences.c.
* graphite-poly.h: Add declarations of scop_get_dependences
and carries_deps.
From-SVN: r213619
Diffstat (limited to 'gcc/graphite-dependences.c')
-rw-r--r-- | gcc/graphite-dependences.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/gcc/graphite-dependences.c b/gcc/graphite-dependences.c index e934d9a..a02bc23 100644 --- a/gcc/graphite-dependences.c +++ b/gcc/graphite-dependences.c @@ -53,6 +53,35 @@ along with GCC; see the file COPYING3. If not see #include "graphite-poly.h" #include "graphite-htab.h" +isl_union_map * +scop_get_dependences (scop_p scop) +{ + isl_union_map *dependences; + + if (!scop->must_raw) + compute_deps (scop, SCOP_BBS (scop), + &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)); + + return dependences; +} + /* Add the constraints from the set S to the domain of MAP. */ static isl_map * @@ -263,6 +292,11 @@ apply_schedule_on_deps (__isl_keep isl_union_map *schedule, ux = isl_union_map_copy (deps); ux = isl_union_map_apply_domain (ux, isl_union_map_copy (trans)); ux = isl_union_map_apply_range (ux, trans); + if (isl_union_map_is_empty (ux)) + { + isl_union_map_free (ux); + return NULL; + } x = isl_map_from_union_map (ux); return x; @@ -300,7 +334,7 @@ no_violations (__isl_keep isl_union_map *schedule, in which all the inputs before DEPTH occur at the same time as the output, and the input at DEPTH occurs before output. */ -static bool +bool carries_deps (__isl_keep isl_union_map *schedule, __isl_keep isl_union_map *deps, int depth) @@ -315,6 +349,8 @@ carries_deps (__isl_keep isl_union_map *schedule, return false; x = apply_schedule_on_deps (schedule, deps); + if (x == NULL) + return false; space = isl_map_get_space (x); space = isl_space_range (space); lex = isl_map_lex_le (space); |