createNextIterationMap from C to C++ interface

Summary: update createNextIterationMap function to new C++ interface.

Reviewers: grosser, Meinersbur, jdoerfert, bollu, cs15btech11044

Reviewed By: cs15btech11044

Subscribers: llvm-commits, pollydev

Tags: #polly

Differential Revision: https://reviews.llvm.org/D47102

llvm-svn: 333113
This commit is contained in:
Tobias Grosser 2018-05-23 18:41:40 +00:00
parent 8990168a45
commit 10da5a0ae7
1 changed files with 13 additions and 13 deletions

View File

@ -2957,19 +2957,19 @@ bool Scop::propagateDomainConstraints(
/// [i0, i1, i2, i3] -> [i0, i1, i2 + 1, i3]
///
/// if @p Dim is 2 and @p SetSpace has 4 dimensions.
static __isl_give isl_map *
createNextIterationMap(__isl_take isl_space *SetSpace, unsigned Dim) {
auto *MapSpace = isl_space_map_from_set(SetSpace);
auto *NextIterationMap = isl_map_universe(isl_space_copy(MapSpace));
for (unsigned u = 0; u < isl_map_dim(NextIterationMap, isl_dim_in); u++)
static isl::map createNextIterationMap(isl::space SetSpace, unsigned Dim) {
isl::space MapSpace = SetSpace.map_from_set();
isl::map NextIterationMap = isl::map::universe(MapSpace);
for (unsigned u = 0; u < NextIterationMap.dim(isl::dim::in); u++)
if (u != Dim)
NextIterationMap =
isl_map_equate(NextIterationMap, isl_dim_in, u, isl_dim_out, u);
auto *C = isl_constraint_alloc_equality(isl_local_space_from_space(MapSpace));
C = isl_constraint_set_constant_si(C, 1);
C = isl_constraint_set_coefficient_si(C, isl_dim_in, Dim, 1);
C = isl_constraint_set_coefficient_si(C, isl_dim_out, Dim, -1);
NextIterationMap = isl_map_add_constraint(NextIterationMap, C);
NextIterationMap.equate(isl::dim::in, u, isl::dim::out, u);
isl::constraint C =
isl::constraint::alloc_equality(isl::local_space(MapSpace));
C = C.set_constant_si(1);
C = C.set_coefficient_si(isl::dim::in, Dim, 1);
C = C.set_coefficient_si(isl::dim::out, Dim, -1);
NextIterationMap = NextIterationMap.add_constraint(C);
return NextIterationMap;
}
@ -2982,8 +2982,8 @@ bool Scop::addLoopBoundsToHeaderDomain(
assert(DomainMap.count(HeaderBB));
isl::set &HeaderBBDom = DomainMap[HeaderBB];
isl::map NextIterationMap = isl::manage(
createNextIterationMap(HeaderBBDom.get_space().release(), LoopDepth));
isl::map NextIterationMap =
createNextIterationMap(HeaderBBDom.get_space(), LoopDepth);
isl::set UnionBackedgeCondition = HeaderBBDom.empty(HeaderBBDom.get_space());