Skip to content

Commit

Permalink
Cut a dependency if the operations with forced to different FUs
Browse files Browse the repository at this point in the history
Fixes OpenASIP GitHub issue #114.
  • Loading branch information
pjaaskel committed Mar 11, 2021
1 parent e50e8a3 commit 0fef0d3
Show file tree
Hide file tree
Showing 4 changed files with 1,163 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2002-2015 Tampere University.
Copyright (c) 2002-2021 Tampere University.
This file is part of TTA-Based Codesign Environment (TCE).
Expand Down Expand Up @@ -30,6 +30,7 @@
* however have been allocated.
*
* @author Heikki Kultala 2006-2009 (heikki.kultala-no.spam-tut.fi)
* @author Pekka Jääskeläinen 2021 (pekka.jaaskelainen tuni fi)
* @note rating: red
*/

Expand Down Expand Up @@ -1641,7 +1642,7 @@ DataDependenceGraphBuilder::createTriggerDependencies(
* @param mn moveNode that is the destination of the dependencies.
* @param dop Operation that mn triggers.
*/
void
void
DataDependenceGraphBuilder::createSideEffectEdges(
MoveNodeUseSet& prevMoves, const MoveNode& mn, Operation& dop) {

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

// Operations forced to different FUs are independent since
// the operation state is per FU. Check if the moves have
// forced set of FUs and if the sets overlap.
if (mn.move().hasAnnotations(
TTAProgram::ProgramAnnotation::ANN_ALLOWED_UNIT_DST) &&
i->mn()->move().hasAnnotations(
TTAProgram::ProgramAnnotation::ANN_ALLOWED_UNIT_DST)) {
bool alwaysDifferentFUs = true;
for (int idx = 0; idx < mn.move().annotationCount(
TTAProgram::ProgramAnnotation::
ANN_ALLOWED_UNIT_DST);
++idx) {
if (i->mn()->move().hasAnnotation(
TTAProgram::ProgramAnnotation::
ANN_ALLOWED_UNIT_DST,
mn.move().annotation(
idx,
TTAProgram::ProgramAnnotation::
ANN_ALLOWED_UNIT_DST).stringValue())) {
alwaysDifferentFUs = false;
break;
}
}
if (alwaysDifferentFUs)
return;
}

if (!currentDDG_->exclusingGuards(*(i->mn()), mn)) {
DataDependenceEdge* dde =
new DataDependenceEdge(
Expand Down
Loading

0 comments on commit 0fef0d3

Please sign in to comment.