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

Commit bd46983

Browse files
author
Sven Verdoolaege
committed
[RFC] use templated isl types reductionUpdates
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 80fe1d7 commit bd46983

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

tc/core/polyhedral/reduction_matcher.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ bool isSupportedReductionUpdateId(isl::id id, const Scop& scop) {
5454

5555
} // namespace
5656

57-
isl::union_set reductionUpdates(isl::union_set domain, const Scop& scop) {
57+
isl::UnionSet<Statement> reductionUpdates(isl::union_set domain, const Scop& scop) {
5858
domain = scop.body.reductions.intersect_domain(domain).domain();
5959
auto update = isl::union_set::empty(domain.get_space());
6060
domain.foreach_set([&update, &scop](isl::set set) {
@@ -63,7 +63,7 @@ isl::union_set reductionUpdates(isl::union_set domain, const Scop& scop) {
6363
update = update.unite(set);
6464
}
6565
});
66-
return update;
66+
return isl::UnionSet<Statement>(update);
6767
}
6868

6969
} // namespace polyhedral

tc/core/polyhedral/schedule_tree_matcher.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <utility>
2020
#include <vector>
2121

22+
#include "tc/core/polyhedral/domain_types.h"
2223
#include "tc/core/polyhedral/schedule_tree.h"
2324
#include "tc/core/polyhedral/scop.h"
2425

@@ -27,7 +28,7 @@ namespace polyhedral {
2728

2829
// Return the union of the reduction update statements
2930
// that appear in "domain".
30-
isl::union_set reductionUpdates(isl::union_set domain, const Scop& scop);
31+
isl::UnionSet<Statement> reductionUpdates(isl::union_set domain, const Scop& scop);
3132

3233
// Does "prefix" partition "domain" into individual reductions?
3334
// In particular, do the elements of "domain" access a single tensor

0 commit comments

Comments
 (0)