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

Commit cd6f059

Browse files
committed
toIslScheduleTree: swap the order of non-core filters below extension
When converting TC ScheduleTree into isl schedule_tree, children of an extension nodes are introduced progressively, starting with "core" children, i.e. those parts of the extension children that relate to the points present in the root domain. Other children are added before(after) the core children using node.graft_before(node.graft_after) on the fist(last) core child. These functions insert the new sibling subtree before(after) the node and return the node itself. Therefore, when calling these functions multiple times, the order in which siblings are added must be inverse to their expected order of appearance. Existing implementation used the direct order, revert it.
1 parent 4798154 commit cd6f059

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/core/polyhedral/schedule_isl_conversion.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,12 @@ isl::schedule_node insertExtension(
156156
}
157157
node = node.ancestor(node.get_tree_depth() - depth0);
158158
}
159-
for (auto i = corePos[0]; i >= 1; --i) {
160-
auto graft = graftFromFilterSubtree(child->child({i - 1}), extension);
159+
for (size_t i = 0; i < corePos[0]; ++i) {
160+
auto graft = graftFromFilterSubtree(child->child({i}), extension);
161161
node = node.graft_before(graft);
162162
}
163-
for (auto i = corePos.back() + 1; i < child->numChildren(); ++i) {
164-
auto graft = graftFromFilterSubtree(child->child({i}), extension);
163+
for (auto i = child->numChildren(); i > corePos.back() + 1; --i) {
164+
auto graft = graftFromFilterSubtree(child->child({i - 1}), extension);
165165
node = node.graft_after(graft);
166166
}
167167
node = node.ancestor(node.get_tree_depth() - depth0);

0 commit comments

Comments
 (0)