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

Commit 37fe91b

Browse files
Merge pull request #574 from facebookresearch/pr/clean-up
clean up updateTopLevelContext
2 parents 6d24f99 + a3bac39 commit 37fe91b

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

tc/core/polyhedral/schedule_transforms.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,10 @@ ScheduleTree* insertTopLevelEmptyBand(ScheduleTree* root) {
286286

287287
void updateTopLevelContext(detail::ScheduleTree* root, isl::set context) {
288288
if (!matchOne(tc::polyhedral::domain(tc::polyhedral::context(any())), root)) {
289-
root->appendChild(ScheduleTree::makeContext(
290-
isl::set::universe(context.get_space()), root->detachChildren()));
289+
root->appendChild(
290+
ScheduleTree::makeContext(context, root->detachChildren()));
291291
}
292-
auto contextElem = const_cast<detail::ScheduleTreeContext*>(
293-
root->child({0})->as<detail::ScheduleTreeContext>());
292+
auto contextElem = root->child({0})->as<detail::ScheduleTreeContext>();
294293
TC_CHECK(contextElem) << "Expected domain(context(any()))";
295294
contextElem->context_ = contextElem->context_ & context;
296295
}

tc/core/polyhedral/schedule_transforms.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ detail::ScheduleTree* insertTopLevelEmptyBand(detail::ScheduleTree* root);
109109

110110
// Update the top-level context node by intersecting it with "context". The
111111
// top-level context node must be located directly under the root of the tree.
112-
// If there is no such node, insert one with universe context first.
112+
// If there is no such node, insert one first.
113113
void updateTopLevelContext(detail::ScheduleTree* root, isl::set context);
114114

115115
// In a tree starting at "root", insert a sequence node with

0 commit comments

Comments
 (0)