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

Commit b0db598

Browse files
author
Sven Verdoolaege
committed
[RFC] use templated isl types prefixScheduleMupa
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 d7a03e1 commit b0db598

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

tc/core/polyhedral/schedule_utils.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,13 @@ isl::multi_union_pw_aff infixScheduleMupa(
251251
return prefix;
252252
}
253253

254+
namespace detail {
254255
isl::multi_union_pw_aff prefixScheduleMupa(
255256
const ScheduleTree* root,
256257
const ScheduleTree* tree) {
257258
return infixScheduleMupa(root, root, tree);
258259
}
260+
} // namespace detail
259261

260262
isl::multi_union_pw_aff partialScheduleMupa(
261263
const detail::ScheduleTree* root,

tc/core/polyhedral/schedule_utils.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
#include "tc/core/check.h"
2121
#include "tc/core/constants.h"
22+
#include "tc/core/polyhedral/domain_types.h"
2223
#include "tc/core/polyhedral/schedule_tree.h"
2324
#include "tc/core/polyhedral/schedule_tree_elem.h"
2425

@@ -78,9 +79,18 @@ isl::multi_union_pw_aff infixScheduleMupa(
7879
// function on the universe domain of the schedule tree.
7980
// Note that unlike isl_schedule_node_get_prefix_schedule_multi_union_pw_aff,
8081
// this function does not take into account any intermediate filter nodes.
82+
namespace detail {
8183
isl::multi_union_pw_aff prefixScheduleMupa(
8284
const detail::ScheduleTree* root,
8385
const detail::ScheduleTree* tree);
86+
}
87+
template <typename Schedule>
88+
isl::MultiUnionPwAff<Statement, Schedule> prefixScheduleMupa(
89+
const detail::ScheduleTree* root,
90+
const detail::ScheduleTree* tree) {
91+
auto prefix = detail::prefixScheduleMupa(root, tree);
92+
return isl::MultiUnionPwAff<Statement, Schedule>(prefix);
93+
}
8494

8595
// Return the concatenation of all outer band node partial schedules,
8696
// including that of the node itself.

0 commit comments

Comments
 (0)