aboutsummaryrefslogtreecommitdiff
path: root/gcc/graphite-sese-to-poly.c
diff options
context:
space:
mode:
authorAditya Kumar <aditya.k7@samsung.com>2016-01-21 02:12:26 +0000
committerSebastian Pop <spop@gcc.gnu.org>2016-01-21 02:12:26 +0000
commit14b1747c9405c21366e75a226a398cc4c16c9cc1 (patch)
treeb30bf643e8bcb9fa2e2a8c6bad0c016831a57322 /gcc/graphite-sese-to-poly.c
parent42d4fbb0f4c012f9cb9d2f95de91d143dac3a3a1 (diff)
downloadgcc-14b1747c9405c21366e75a226a398cc4c16c9cc1.zip
gcc-14b1747c9405c21366e75a226a398cc4c16c9cc1.tar.gz
gcc-14b1747c9405c21366e75a226a398cc4c16c9cc1.tar.bz2
add more coalescing to simplify constraints
* graphite-dependences.c (constrain_domain): Add call to isl_*_coalesce. (add_pdr_constraints): Same. (scop_get_reads): Same. (scop_get_must_writes): Same. (scop_get_may_writes): Same. (scop_get_original_schedule): Same. (extend_schedule): Same. (apply_schedule_on_deps): Same. (carries_deps): Same. (compute_deps): Same. (scop_get_dependences): Same. * graphite-isl-ast-to-gimple.c (translate_isl_ast_to_gimple::generate_isl_schedule): Same. * graphite-optimize-isl.c (get_schedule_for_band): Same. (get_schedule_for_band_list): Same. (get_schedule_map): Same. (apply_schedule_map_to_scop): Same. * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Same. (build_loop_iteration_domains): Same. (add_condition_to_pbb): Same. (add_param_constraints): Same. (pdr_add_memory_accesses): Same. (pdr_add_data_dimensions): Same. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r232650
Diffstat (limited to 'gcc/graphite-sese-to-poly.c')
-rw-r--r--gcc/graphite-sese-to-poly.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index e7c384d..3803d58 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -143,6 +143,10 @@ build_pbb_scattering_polyhedrons (isl_aff *static_sched,
}
}
+ /* Simplify the original schedule. */
+ pbb->schedule = isl_map_coalesce (pbb->schedule);
+
+ /* At the beginning, set the transformed schedule to the original. */
pbb->transformed = isl_map_copy (pbb->schedule);
}
@@ -482,7 +486,7 @@ build_loop_iteration_domains (scop_p scop, struct loop *loop,
isl_constraint *c = isl_inequality_alloc
(isl_local_space_from_space (isl_space_copy (space)));
c = isl_constraint_set_coefficient_si (c, isl_dim_set, pos, 1);
- inner = isl_set_add_constraint (inner, c);
+ inner = isl_set_coalesce (isl_set_add_constraint (inner, c));
/* loop_i <= cst_nb_iters */
if (TREE_CODE (nb_iters) == INTEGER_CST)
@@ -513,7 +517,8 @@ build_loop_iteration_domains (scop_p scop, struct loop *loop,
isl_set_dim (valid, isl_dim_set));
if (valid)
- scop->param_context = isl_set_intersect (scop->param_context, valid);
+ scop->param_context = isl_set_coalesce
+ (isl_set_intersect (scop->param_context, valid));
isl_local_space *ls = isl_local_space_from_space (isl_space_copy (space));
isl_aff *al = isl_aff_set_coefficient_si (isl_aff_zero_on_domain (ls),
@@ -541,7 +546,8 @@ build_loop_iteration_domains (scop_p scop, struct loop *loop,
isl_set *x = isl_pw_aff_ge_set (approx, aff);
x = isl_set_project_out (x, isl_dim_set, 0,
isl_set_dim (x, isl_dim_set));
- scop->param_context = isl_set_intersect (scop->param_context, x);
+ scop->param_context = isl_set_coalesce
+ (isl_set_intersect (scop->param_context, x));
isl_constraint *c = isl_inequality_alloc
(isl_local_space_from_space (isl_space_copy (space)));
@@ -557,6 +563,7 @@ build_loop_iteration_domains (scop_p scop, struct loop *loop,
else
gcc_unreachable ();
+ inner = isl_set_coalesce (inner);
if (loop->inner
&& !build_loop_iteration_domains (scop, loop->inner, nb + 1,
isl_set_copy (inner), doms))
@@ -648,7 +655,7 @@ add_condition_to_pbb (poly_bb_p pbb, gcond *stmt, enum tree_code code)
cond = isl_set_coalesce (cond);
cond = isl_set_set_tuple_id (cond, isl_set_get_tuple_id (pbb->domain));
- pbb->domain = isl_set_intersect (pbb->domain, cond);
+ pbb->domain = isl_set_coalesce (isl_set_intersect (pbb->domain, cond));
return true;
}
@@ -749,7 +756,8 @@ add_param_constraints (scop_p scop, graphite_dim_t p)
c = isl_constraint_set_constant_val (c, v);
c = isl_constraint_set_coefficient_si (c, isl_dim_param, p, 1);
- scop->param_context = isl_set_add_constraint (scop->param_context, c);
+ scop->param_context = isl_set_coalesce
+ (isl_set_add_constraint (scop->param_context, c));
}
if (ub)
@@ -768,7 +776,8 @@ add_param_constraints (scop_p scop, graphite_dim_t p)
c = isl_constraint_set_constant_val (c, v);
c = isl_constraint_set_coefficient_si (c, isl_dim_param, p, -1);
- scop->param_context = isl_set_add_constraint (scop->param_context, c);
+ scop->param_context = isl_set_coalesce
+ (isl_set_add_constraint (scop->param_context, c));
}
}
@@ -911,7 +920,7 @@ pdr_add_memory_accesses (isl_map *acc, dr_info &dri)
acc = set_index (acc, i + 1, aff);
}
- return acc;
+ return isl_map_coalesce (acc);
}
/* Return true when the LOW and HIGH bounds of an array reference REF are valid
@@ -972,7 +981,8 @@ pdr_add_data_dimensions (isl_set *subscript_sizes, scop_p scop,
isl_set *valid = isl_pw_aff_nonneg_set (isl_pw_aff_copy (ub));
valid = isl_set_project_out (valid, isl_dim_set, 0,
isl_set_dim (valid, isl_dim_set));
- scop->param_context = isl_set_intersect (scop->param_context, valid);
+ scop->param_context = isl_set_coalesce
+ (isl_set_intersect (scop->param_context, valid));
isl_aff *aff
= isl_aff_zero_on_domain (isl_local_space_from_space (space));
@@ -992,7 +1002,7 @@ pdr_add_data_dimensions (isl_set *subscript_sizes, scop_p scop,
subscript_sizes = isl_set_intersect (subscript_sizes, ubs);
}
- return subscript_sizes;
+ return isl_set_coalesce (subscript_sizes);
}
/* Build data accesses for DRI. */