[polly] r333113 - createNextIterationMap from C to C++ interface
Tobias Grosser via llvm-commits
llvm-commits at lists.llvm.org
Wed May 23 11:41:40 PDT 2018
Author: grosser
Date: Wed May 23 11:41:40 2018
New Revision: 333113
URL: http://llvm.org/viewvc/llvm-project?rev=333113&view=rev
Log:
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
Modified:
polly/trunk/lib/Analysis/ScopInfo.cpp
Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=333113&r1=333112&r2=333113&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Wed May 23 11:41:40 2018
@@ -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());
More information about the llvm-commits
mailing list