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

Commit b37dbbb

Browse files
author
Sven Verdoolaege
committed
[RFC] use templated isl types Scop::domain()
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 931eeed commit b37dbbb

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

tc/core/polyhedral/scop.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ isl::union_set& Scop::domainRef() {
9797
return dom->domain_;
9898
}
9999

100-
const isl::union_set Scop::domain() const {
101-
return const_cast<Scop*>(this)->domainRef();
100+
const isl::UnionSet<Statement> Scop::domain() const {
101+
return isl::UnionSet<Statement>(const_cast<Scop*>(this)->domainRef());
102102
}
103103

104104
std::ostream& operator<<(std::ostream& os, const Scop& s) {

tc/core/polyhedral/scop.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "tc/core/halide2isl.h"
2828
#include "tc/core/mapping_options.h"
2929
#include "tc/core/polyhedral/body.h"
30+
#include "tc/core/polyhedral/domain_types.h"
3031
#include "tc/core/polyhedral/schedule_transforms.h"
3132
#include "tc/core/polyhedral/schedule_tree.h"
3233
#include "tc/core/tc2halide.h"
@@ -134,7 +135,7 @@ struct Scop {
134135
isl::Set<> makeContext(
135136
const std::unordered_map<std::string, T>& sizes =
136137
std::unordered_map<std::string, T>()) const {
137-
auto s = isl::Space<>(domain().get_space());
138+
auto s = domain().get_space();
138139
return makeSpecializationSet(s, sizes);
139140
}
140141

@@ -508,7 +509,7 @@ struct Scop {
508509
isl::union_set& domainRef();
509510

510511
public:
511-
const isl::union_set domain() const;
512+
const isl::UnionSet<Statement> domain() const;
512513
// The parameter values of a specialized Scop.
513514
std::unordered_map<std::string, int> parameterValues;
514515

0 commit comments

Comments
 (0)