// 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())