Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit 0b611f4

Browse files
author
Sven Verdoolaege
committed
[RFC] use templated isl types makeSpecializationSet
Templated isl types require the user to specify the domain and range universes of isl objects, allowing the compiler to check whether it makes sense to combine pairs of objects. This RFC only converts isPromotableToRegistersBelow and some related functions to illustrate the effect. The isPromotableToRegistersBelow was already applying operations correctly, so the code itself did not require any changes. However, one variable was reused to store different types of intermediate result and this one had to be split up into several variables because they now have different types.
1 parent 66e8144 commit 0b611f4

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

tc/core/polyhedral/scop.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ struct Scop {
134134
isl::set makeContext(
135135
const std::unordered_map<std::string, T>& sizes =
136136
std::unordered_map<std::string, T>()) const {
137-
auto s = domain().get_space();
137+
auto s = isl::Space<>(domain().get_space());
138138
return makeSpecializationSet(s, sizes);
139139
}
140140

tc/external/detail/islpp.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -322,18 +322,18 @@ inline isl::set makeParameterContext(
322322
// that ties the space parameter to the values.
323323
//
324324
template <typename T>
325-
inline isl::set makeSpecializationSet(
326-
isl::space space,
325+
inline isl::Set<> makeSpecializationSet(
326+
isl::Space<> space,
327327
const std::unordered_map<std::string, T>& paramValues) {
328328
auto ctx = space.get_ctx();
329329
for (auto kvp : paramValues) {
330330
space = space.add_param(isl::id(ctx, kvp.first));
331331
}
332-
auto set = isl::set::universe(space);
332+
auto set = isl::Set<>::universe(space);
333333
for (auto kvp : paramValues) {
334334
auto id = isl::id(ctx, kvp.first);
335-
isl::aff affParam(isl::aff::param_on_domain_space(space, id));
336-
set = set & (isl::aff_set(affParam) == kvp.second);
335+
auto affParam(isl::AffOn<>::param_on_domain_space(space, id));
336+
set = set & (isl::PwAffOn<>(affParam - kvp.second)).zero_set();
337337
}
338338
return set;
339339
}

0 commit comments

Comments
 (0)