summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2014-12-07 22:51:45 +0000
committerTobias Grosser <tobias@grosser.es>2014-12-07 22:51:45 +0000
commit05fdab9362bd92ad40e7f45dd7f65107ba04cc52 (patch)
tree371c418eee2c7ae773d8731fcadbf9dc456a9826
parent16173b7f6c9f3a967c0527f7b8ddc234edd27cd9 (diff)
downloadbcm5719-llvm-05fdab9362bd92ad40e7f45dd7f65107ba04cc52.tar.gz
bcm5719-llvm-05fdab9362bd92ad40e7f45dd7f65107ba04cc52.zip
Simplify computation of reduction dependences
This simplifies the construction of the input for the reduction dependence computation and at the same time removes an assumption that expects the schedule to be of 2D + 1 form (the odd dimensions giving textual order, the even dimensions the loop iterations). llvm-svn: 223621
-rw-r--r--polly/lib/Analysis/Dependences.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/polly/lib/Analysis/Dependences.cpp b/polly/lib/Analysis/Dependences.cpp
index 71d8780a2af..c9cc7780bb5 100644
--- a/polly/lib/Analysis/Dependences.cpp
+++ b/polly/lib/Analysis/Dependences.cpp
@@ -102,17 +102,11 @@ void Dependences::collectInfo(Scop &S, isl_union_map **Read,
// but as we transformed the access domain we need the scattering
// to match the new access domains, thus we need
// [Stmt[i0, i1] -> MemAcc_A[i0 + i1]] -> [0, i0, 2, i1, 0]
+ isl_map *Scatter = Stmt->getScattering();
+ Scatter = isl_map_apply_domain(
+ Scatter, isl_map_reverse(isl_map_domain_map(isl_map_copy(accdom))));
accdom = isl_map_range_map(accdom);
-
- isl_map *stmt_scatter = Stmt->getScattering();
- isl_set *scatter_dom = isl_map_domain(isl_map_copy(accdom));
- isl_set *scatter_ran = isl_map_range(stmt_scatter);
- isl_map *scatter =
- isl_map_from_domain_and_range(scatter_dom, scatter_ran);
- for (unsigned u = 0, e = Stmt->getNumIterators(); u != e; u++)
- scatter =
- isl_map_equate(scatter, isl_dim_out, 2 * u + 1, isl_dim_in, u);
- *AccessSchedule = isl_union_map_add_map(*AccessSchedule, scatter);
+ *AccessSchedule = isl_union_map_add_map(*AccessSchedule, Scatter);
}
if (MA->isRead())
OpenPOWER on IntegriCloud