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

Commit 56a0343

Browse files
committed
promoteToSharedBelow: disallow promotion below sequence/set
Schedule tree invariants prevent us from inserting an extension node, necessary to copy data during promotion, as a child of a sequence or a set node.
1 parent d9aef27 commit 56a0343

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tc/core/polyhedral/cuda/memory_promotion_heuristic.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,14 @@ void promoteToSharedBelow(
439439
detail::ScheduleTree* node,
440440
size_t& remainingMemory) {
441441
auto root = scop.scheduleRoot();
442+
443+
// Children of a sequence/set band must be filters, but promotion would
444+
// insert an extension node.
445+
if (node->as<detail::ScheduleTreeSequence>() ||
446+
node->as<detail::ScheduleTreeSet>()) {
447+
throw promotion::IncorrectScope("cannot promote below a sequence/set node");
448+
}
449+
442450
auto partialSched = partialSchedule(root, node);
443451
auto mapping = collectMappingsTo<mapping::BlockId>(scop);
444452

0 commit comments

Comments
 (0)