Skip to content

Commit 0fef0d3

Browse files
committed
Cut a dependency if the operations with forced to different FUs
Fixes OpenASIP GitHub issue #114.
1 parent e50e8a3 commit 0fef0d3

File tree

4 files changed

+1163
-2
lines changed

4 files changed

+1163
-2
lines changed

tce/src/applibs/Scheduler/ProgramRepresentations/DDG/DataDependenceGraphBuilder.cc

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2002-2015 Tampere University.
2+
Copyright (c) 2002-2021 Tampere University.
33
44
This file is part of TTA-Based Codesign Environment (TCE).
55
@@ -30,6 +30,7 @@
3030
* however have been allocated.
3131
*
3232
* @author Heikki Kultala 2006-2009 (heikki.kultala-no.spam-tut.fi)
33+
* @author Pekka Jääskeläinen 2021 (pekka.jaaskelainen tuni fi)
3334
* @note rating: red
3435
*/
3536

@@ -1641,7 +1642,7 @@ DataDependenceGraphBuilder::createTriggerDependencies(
16411642
* @param mn moveNode that is the destination of the dependencies.
16421643
* @param dop Operation that mn triggers.
16431644
*/
1644-
void
1645+
void
16451646
DataDependenceGraphBuilder::createSideEffectEdges(
16461647
MoveNodeUseSet& prevMoves, const MoveNode& mn, Operation& dop) {
16471648

@@ -1655,6 +1656,33 @@ DataDependenceGraphBuilder::createSideEffectEdges(
16551656
if ((&dop == &o && o.hasSideEffects()) ||
16561657
dop.dependsOn(o) || o.dependsOn(dop)) {
16571658

1659+
// Operations forced to different FUs are independent since
1660+
// the operation state is per FU. Check if the moves have
1661+
// forced set of FUs and if the sets overlap.
1662+
if (mn.move().hasAnnotations(
1663+
TTAProgram::ProgramAnnotation::ANN_ALLOWED_UNIT_DST) &&
1664+
i->mn()->move().hasAnnotations(
1665+
TTAProgram::ProgramAnnotation::ANN_ALLOWED_UNIT_DST)) {
1666+
bool alwaysDifferentFUs = true;
1667+
for (int idx = 0; idx < mn.move().annotationCount(
1668+
TTAProgram::ProgramAnnotation::
1669+
ANN_ALLOWED_UNIT_DST);
1670+
++idx) {
1671+
if (i->mn()->move().hasAnnotation(
1672+
TTAProgram::ProgramAnnotation::
1673+
ANN_ALLOWED_UNIT_DST,
1674+
mn.move().annotation(
1675+
idx,
1676+
TTAProgram::ProgramAnnotation::
1677+
ANN_ALLOWED_UNIT_DST).stringValue())) {
1678+
alwaysDifferentFUs = false;
1679+
break;
1680+
}
1681+
}
1682+
if (alwaysDifferentFUs)
1683+
return;
1684+
}
1685+
16581686
if (!currentDDG_->exclusingGuards(*(i->mn()), mn)) {
16591687
DataDependenceEdge* dde =
16601688
new DataDependenceEdge(

0 commit comments

Comments
 (0)