From 3aefba3f208fc44eaa2d5aaffbd449b61c7dc993 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Tue, 22 Mar 2016 18:12:20 +0100 Subject: [PATCH] gpu.c: compute_sync_writes: take into account expansions The schedule trees from which kernels are extracted currently do not contain any expansions, but this may change when statement instances are combined during scheduling. Take such expansions into account. Signed-off-by: Sven Verdoolaege --- gpu.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gpu.c b/gpu.c index c546c5e..5e9c014 100644 --- a/gpu.c +++ b/gpu.c @@ -3702,14 +3702,22 @@ static __isl_give isl_union_set *compute_sync_writes( isl_union_map *equal; isl_union_set *wrap; isl_union_set *domain; + isl_union_pw_multi_aff *contraction; - domain = isl_schedule_node_get_universe_domain(node); kernel_prefix = isl_schedule_node_get_prefix_schedule_union_map(node); node = isl_schedule_node_copy(node); node = gpu_tree_move_down_to_thread(node, kernel->core); thread_prefix = isl_schedule_node_get_prefix_schedule_union_map(node); isl_schedule_node_free(node); + contraction = kernel->contraction; + kernel_prefix = isl_union_map_preimage_domain_union_pw_multi_aff( + kernel_prefix, isl_union_pw_multi_aff_copy(contraction)); + thread_prefix = isl_union_map_preimage_domain_union_pw_multi_aff( + thread_prefix, isl_union_pw_multi_aff_copy(contraction)); + domain = isl_union_set_copy(kernel->expanded_domain); + domain = isl_union_set_universe(domain); + may_writes = isl_union_map_copy(kernel->prog->scop->tagged_may_writes); may_writes = isl_union_map_curry(may_writes); may_writes = isl_union_map_intersect_domain(may_writes, domain); -- 2.11.4.GIT