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

Commit 74c76ca

Browse files
committed
Scop: extract insertSyncsAroundSeqChildren
This function inserts synchronizations before the first and after the last child of a sequence node. It will be used in an upcoming commit.
1 parent 5f456b3 commit 74c76ca

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

tc/core/polyhedral/scop.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,13 @@ void Scop::insertSyncsAroundCopies(ScheduleTree* tree) {
243243
++i;
244244
}
245245
}
246+
insertSyncsAroundSeqChildren(seqNode);
247+
}
248+
249+
void Scop::insertSyncsAroundSeqChildren(detail::ScheduleTree* seqNode) {
250+
TC_CHECK(seqNode->elemAs<detail::ScheduleTreeElemSequence>())
251+
<< "expected sequence node, got\n"
252+
<< *seqNode;
246253
insertSync(seqNode, 0);
247254
insertSync(seqNode, seqNode->numChildren());
248255
}

tc/core/polyhedral/scop.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,10 @@ struct Scop {
461461
//
462462
void insertSyncsAroundCopies(detail::ScheduleTree* tree);
463463

464+
// Given a sequence node, insert synchronizations before its first child node
465+
// and after its last child node.
466+
void insertSyncsAroundSeqChildren(detail::ScheduleTree* tree);
467+
464468
private:
465469
// Compute a schedule satisfying the given schedule constraints and
466470
// taking into account the scheduler options.

0 commit comments

Comments
 (0)