OpenASIP  2.0
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
DataDependenceEdge Class Reference

#include <DataDependenceEdge.hh>

Inheritance diagram for DataDependenceEdge:
Inheritance graph
Collaboration diagram for DataDependenceEdge:
Collaboration graph

Public Types

enum  DependenceType {
  DEP_UNKNOWN = 0, DEP_RAW = 1, DEP_WAR = 2, DEP_WAW = 3,
  DEP_TRIGGER = 4
}
 
enum  EdgeReason {
  EDGE_REGISTER, EDGE_MEMORY, EDGE_FUSTATE, EDGE_OPERATION,
  EDGE_RA
}
 

Public Member Functions

 DataDependenceEdge (EdgeReason edgereason, DependenceType deptype, TCEString data, bool guard=false, bool certainAlias=false, bool tailPseudo=false, bool headPseudo=false, int loop=0)
 
 DataDependenceEdge (EdgeReason edgereason, DependenceType deptype, bool guard=false, bool certainAlias=false, bool tailPseudo=false, bool headPseudo=false, int loop=0)
 
 DataDependenceEdge (const DataDependenceEdge &other)
 
 DataDependenceEdge (const DataDependenceEdge &other, bool invertLoop)
 
virtual ~DataDependenceEdge ()
 
TCEString toString () const
 
TCEString toString (MoveNode &tail) const
 
ObjectStatesaveState (const MoveNode &tail, const MoveNode &head)
 
DependenceType dependenceType () const
 
EdgeReason edgeReason () const
 
bool isFalseDep () const
 
bool guardUse () const
 
bool certainAlias () const
 
bool tailPseudo () const
 
bool headPseudo () const
 
bool isBackEdge () const
 
int loopDepth () const
 
bool isGPREdge () const
 
bool isRegisterOrRA () const
 
bool isWAW () const
 
bool isRAW () const
 
const TCEString data () const
 
bool operator== (const DataDependenceEdge &other) const
 
void setData (const TCEString &newData)
 
- Public Member Functions inherited from GraphEdge
 GraphEdge ()
 
 GraphEdge (const GraphEdge &edge)
 
virtual GraphEdgeclone () const
 
virtual ~GraphEdge ()
 
virtual int edgeID () const
 
virtual TCEString dotString () const
 
int weight () const
 
void setWeight (int w)
 

Static Public Member Functions

static void printStats (std::ostream &out)
 

Static Public Attributes

static int regAntidepCount_ = 0
 

Private Types

enum  EdgePropertyFlags { EPF_GUARD = 1 << 0, EPF_CERTAIN_ALIAS = 1 << 1, EPF_TAIL_PSEUDO = 1 << 2, EPF_HEAD_PSEUDO = 1 << 3 }
 

Private Member Functions

TCEString depTypeSt () const
 
TCEString edgeReasonSt () const
 
TCEString guardSt () const
 
TCEString pseudoSt () const
 
TCEString latencySt (MoveNode &node) const
 

Private Attributes

unsigned char dependenceType_
 
unsigned char edgeReason_
 
unsigned char edgeProperties_
 
unsigned char loopEdge_
 
char * data_
 

Detailed Description

Definition at line 43 of file DataDependenceEdge.hh.

Member Enumeration Documentation

◆ DependenceType

Enumerator
DEP_UNKNOWN 
DEP_RAW 
DEP_WAR 
DEP_WAW 
DEP_TRIGGER 

Definition at line 45 of file DataDependenceEdge.hh.

45  {
46  DEP_UNKNOWN = 0,
47  DEP_RAW = 1,
48  DEP_WAR = 2,
49  DEP_WAW = 3,
50  DEP_TRIGGER = 4};

◆ EdgePropertyFlags

Enumerator
EPF_GUARD 
EPF_CERTAIN_ALIAS 
EPF_TAIL_PSEUDO 
EPF_HEAD_PSEUDO 

Definition at line 169 of file DataDependenceEdge.hh.

169  {
170  EPF_GUARD = 1 << 0,
171  EPF_CERTAIN_ALIAS = 1 << 1,
172  EPF_TAIL_PSEUDO = 1 << 2,
173  EPF_HEAD_PSEUDO = 1 << 3
174  };

◆ EdgeReason

Enumerator
EDGE_REGISTER 
EDGE_MEMORY 
EDGE_FUSTATE 
EDGE_OPERATION 
EDGE_RA 

Definition at line 52 of file DataDependenceEdge.hh.

52  {
57  EDGE_RA};

Constructor & Destructor Documentation

◆ DataDependenceEdge() [1/4]

DataDependenceEdge::DataDependenceEdge ( EdgeReason  edgereason,
DependenceType  deptype,
TCEString  data,
bool  guard = false,
bool  certainAlias = false,
bool  tailPs = false,
bool  headPs = false,
int  loopEdge = 0 
)

Constructor.

Parameters
edgereasonwhich kind of data caused this dependence, is it register, memory, operation, ra etc.
deptypewhether this is real dependence(raw), antidependence(war) or output dependence(waw)
datasome data about the dependence, for example reg name.
guardif this dependence is a guard use.
certainAliasif this memory dep is a known to always alias.
tailPSwhether the tail of the dep is a pseudo data usage
headPSwhether the head of the dep is a pseudo data usage
loopEdgeloop iteration depth if the dependence goes over a loop

Definition at line 65 of file DataDependenceEdge.cc.

70  :
71  dependenceType_(deptype), edgeReason_(edgereason),
72  loopEdge_(loopEdge) {
73 
74  edgeProperties_ = 0;
75  if (guard)
77 
78  if (certainAlias)
80 
81  if (tailPs)
83 
84  if (headPs)
86 
87  assert(loopEdge < UCHAR_MAX);
88  loopEdge = (unsigned char)loopEdge_;
89 
90  data_ = NULL;
91  setData(data);
92  if (edgeReason_ == EDGE_REGISTER) {
93  assert(data_ != NULL && "Register name required for reg deps");
94  }
95 }

References assert, certainAlias(), data(), data_, EDGE_REGISTER, edgeProperties_, edgeReason_, EPF_CERTAIN_ALIAS, EPF_GUARD, EPF_HEAD_PSEUDO, EPF_TAIL_PSEUDO, loopEdge_, and setData().

Here is the call graph for this function:

◆ DataDependenceEdge() [2/4]

DataDependenceEdge::DataDependenceEdge ( EdgeReason  edgereason,
DependenceType  deptype,
bool  guard = false,
bool  certainAlias = false,
bool  tailPs = false,
bool  headPs = false,
int  loopEdge = 0 
)

Constructor.

Parameters
edgereasonwhich kind of data caused this dependence, is it register, memory, operation, ra etc.
deptypewhether this is real dependence(raw), antidependence(war) or output dependence(waw)
guardif this dependence is a guard use.
certainAliasif this memory dep is a known to always alias.
tailPSwhether the tail of the dep is a pseudo data usage
headPSwhether the head of the dep is a pseudo data usage
loopEdgeloop iteration depth if the dependence goes over a loop

Definition at line 110 of file DataDependenceEdge.cc.

115  :
116  dependenceType_(deptype), edgeReason_(edgereason),
117  loopEdge_(loopEdge) {
118 
119  edgeProperties_ = 0;
120  if (guard)
122 
123  if (certainAlias)
125 
126  if (tailPs)
128 
129  if (headPs)
131 
132  assert(loopEdge < UCHAR_MAX);
133  loopEdge = (unsigned char)loopEdge_;
134  data_ = NULL;
135  if (edgeReason_ == EDGE_REGISTER) {
136  assert(0 && "Register name required for reg deps");
137  }
138 
139 }

References assert, certainAlias(), data_, EDGE_REGISTER, edgeProperties_, edgeReason_, EPF_CERTAIN_ALIAS, EPF_GUARD, EPF_HEAD_PSEUDO, EPF_TAIL_PSEUDO, and loopEdge_.

Here is the call graph for this function:

◆ DataDependenceEdge() [3/4]

DataDependenceEdge::DataDependenceEdge ( const DataDependenceEdge other)

Copy constructor.

Because of data_ that needs to be deep copied.

Definition at line 146 of file DataDependenceEdge.cc.

146  :
147  GraphEdge() {
148  this->dependenceType_ = other.dependenceType_;
149  this->edgeReason_ = other.edgeReason_;
150  this->edgeProperties_ = other.edgeProperties_;
151  this->loopEdge_ = other.loopEdge_;
152  if (other.data_ != NULL) {
153  data_ = new char[strlen(other.data_)+1];
154  strcpy(data_, other.data_);
155  } else {
156  data_ = NULL;
157  }
158 }

References data_, dependenceType_, edgeProperties_, edgeReason_, and loopEdge_.

◆ DataDependenceEdge() [4/4]

DataDependenceEdge::DataDependenceEdge ( const DataDependenceEdge other,
bool  invertLoop 
)

Copy constructor which may modify the loop property

Parameters
otheredge to copy @invertLoop whether to invent oop propert 0->1, 1->0

Definition at line 166 of file DataDependenceEdge.cc.

167  :
168  GraphEdge() {
169  this->dependenceType_ = other.dependenceType_;
170  this->edgeReason_ = other.edgeReason_;
171  this->edgeProperties_ = other.edgeProperties_;
172  if (!invertLoop || other.loopEdge_ > 1) {
173  this->loopEdge_ = other.loopEdge_;
174  } else {
175  this->loopEdge_ = !other.loopEdge_;
176  }
177  if (other.data_ != NULL) {
178  data_ = new char[strlen(other.data_)+1];
179  strcpy(data_, other.data_);
180  } else {
181  data_ = NULL;
182  }
183 }

References data_, dependenceType_, edgeProperties_, edgeReason_, and loopEdge_.

◆ ~DataDependenceEdge()

virtual DataDependenceEdge::~DataDependenceEdge ( )
inlinevirtual

Definition at line 75 of file DataDependenceEdge.hh.

75  {
76  delete[] data_;
77  data_ = NULL;
78  }

References data_.

Member Function Documentation

◆ certainAlias()

bool DataDependenceEdge::certainAlias ( ) const
inline

◆ data()

const TCEString DataDependenceEdge::data ( ) const
inline

◆ dependenceType()

DependenceType DataDependenceEdge::dependenceType ( ) const
inline

Definition at line 88 of file DataDependenceEdge.hh.

88  {
89  return static_cast<DependenceType>(dependenceType_);
90  }

References dependenceType_.

Referenced by ResourceConstraintAnalyzer::analyzeRegisterAntideps(), CycleLookBackSoftwareBypasser::bypassNode(), BFRemoveLoopChecksAndJump::checkAliveMove(), BFRemoveLoopChecksAndJump::checkAlivePO(), PreOptimizer::checkGuardReversalAllowed(), CopyingDelaySlotFiller::checkIncomingDeps(), DataDependenceGraph::combineNodes(), DataDependenceGraph::copyDepsOver(), DataDependenceGraph::copyIncomingGuardEdges(), DataDependenceGraph::copyIncomingRawEdges(), DataDependenceGraph::copyOutgoingGuardWarEdges(), DataDependenceGraph::destRenamed(), DataDependenceGraph::earliestCycle(), DataDependenceGraph::edgeLatency(), DataDependenceGraph::edgeWeight(), BF2Scheduler::findBypassEdge(), DataDependenceGraph::findBypassSource(), DataDependenceGraph::findLimitingAntidependenceDestination(), DataDependenceGraph::findLimitingAntidependenceSource(), DataDependenceGraph::findLiveRange(), DataDependenceGraph::findLoopIndexInit(), DataDependenceGraph::fixAntidepsAfterLoopUnmergeUser(), RegisterCopyAdder::fixDDGEdgesInTempReg(), RegisterCopyAdder::fixDDGEdgesInTempRegChain(), RegisterCopyAdder::fixDDGEdgesInTempRegChainImmediate(), DataDependenceGraph::guardConverted(), DataDependenceGraph::guardDefMoves(), DataDependenceGraph::guardRawPredecessors(), DataDependenceGraph::guardRenamed(), DataDependenceGraph::guardRestored(), DataDependenceGraph::hasRegWaw(), PreOptimizer::inverseGuardsOfHeads(), DataDependenceGraph::isLoopBypass(), DataDependenceGraph::isLoopInvariant(), DataDependenceGraph::latestCycle(), DataDependenceGraph::mergeAndKeepAllowed(), DataDependenceGraph::mergeAndKeepSource(), DataDependenceGraph::mergeAndKeepUser(), ProgramDependenceGraph::moveDDGedges(), DataDependenceGraph::onlyIncomingGuard(), DataDependenceGraph::onlyRegisterRawDestinations(), DataDependenceGraph::onlyRegisterRawDestinationsWithEdges(), DataDependenceGraph::onlyRegisterRawSource(), BFRemoveLoopChecksAndJump::operator()(), DataDependenceGraph::queueRawPredecessors(), LiveRangeData::registersAlive(), DataDependenceGraph::regRawPredecessors(), DataDependenceGraph::regRawSuccessors(), DataDependenceGraph::regWarSuccessors(), DataDependenceGraph::regWawSuccessors(), DataDependenceGraph::removeIncomingGuardEdges(), BFRemoveLoopChecksAndJump::removeMoveFromQueue(), DataDependenceGraph::removeOutgoingGuardWarEdges(), BFRemoveLoopChecksAndJump::removePoFromQueue(), DataDependenceGraph::removeRAWEdges(), DataDependenceGraph::renamedSimpleLiveRange(), DataDependenceGraph::resultUsed(), DataDependenceGraph::sanityCheck(), DataDependenceGraph::sourceRenamed(), PreOptimizer::tryToOptimizeAddressReg(), BUBasicBlockScheduler::tryToOptimizeWaw(), BasicBlockScheduler::tryToOptimizeWaw(), DataDependenceGraph::unMergeUser(), and BFMergeAndKeepUser::updateEdges().

◆ depTypeSt()

TCEString DataDependenceEdge::depTypeSt ( ) const
private

Helper method for creating the toString string.

Definition at line 258 of file DataDependenceEdge.cc.

258  {
259  switch (dependenceType_) {
260  case DEP_RAW:
261  return "_raw";
262  case DEP_WAR:
263  return "_war";
264  case DEP_WAW:
265  return "_waw";
266  case DEP_UNKNOWN:
267  default:
268  return "";
269  }
270 }

References DEP_RAW, DEP_UNKNOWN, DEP_WAR, DEP_WAW, and dependenceType_.

Referenced by toString().

◆ edgeReason()

EdgeReason DataDependenceEdge::edgeReason ( ) const
inline

Definition at line 91 of file DataDependenceEdge.hh.

91  {
92  return static_cast<EdgeReason>(edgeReason_);
93  }

References edgeReason_.

Referenced by ResourceConstraintAnalyzer::analyzeRegisterAntideps(), CycleLookBackSoftwareBypasser::bypassNode(), DataDependenceGraph::combineNodes(), DataDependenceGraph::copyDepsOver(), DataDependenceGraph::copyIncomingGuardEdges(), DataDependenceGraph::copyIncomingRawEdges(), DataDependenceGraph::copyOutgoingGuardWarEdges(), DataDependenceGraph::destRenamed(), DataDependenceGraph::dotString(), DataDependenceGraph::earliestCycle(), DataDependenceGraph::edgeLatency(), DataDependenceGraph::edgeWeight(), BF2Scheduler::findBypassEdge(), DataDependenceGraph::findBypassSource(), DataDependenceGraph::findLimitingAntidependenceDestination(), DataDependenceGraph::findLimitingAntidependenceSource(), DataDependenceGraph::findLiveRange(), DataDependenceGraph::findLoopIndexInit(), DataDependenceGraph::fixAntidepsAfterLoopUnmergeUser(), RegisterCopyAdder::fixDDGEdgesInTempReg(), RegisterCopyAdder::fixDDGEdgesInTempRegChain(), RegisterCopyAdder::fixDDGEdgesInTempRegChainImmediate(), DataDependenceGraph::guardConverted(), DataDependenceGraph::guardRenamed(), DataDependenceGraph::guardRestored(), DataDependenceGraph::hasRegWaw(), isGPREdge(), ExecutionPipelineResource::isLoopBypass(), DataDependenceGraph::isLoopInvariant(), DataDependenceGraph::isNotAvoidable(), isRegisterOrRA(), DataDependenceGraph::latestCycle(), DataDependenceGraph::memoryDependenceGraph(), DataDependenceGraph::mergeAndKeepAllowed(), DataDependenceGraph::mergeAndKeepSource(), DataDependenceGraph::mergeAndKeepUser(), ProgramDependenceGraph::moveDDGedges(), DataDependenceGraph::moveFUDependenciesToTrigger(), DataDependenceGraph::onlyRegisterEdgeIn(), DataDependenceGraph::onlyRegisterEdgeOut(), DataDependenceGraph::onlyRegisterRawDestinations(), DataDependenceGraph::onlyRegisterRawDestinationsWithEdges(), DataDependenceGraph::onlyRegisterRawSource(), DataDependenceGraph::operationInEdges(), DataDependenceGraph::queueRawPredecessors(), LiveRangeData::registersAlive(), DataDependenceGraph::regRawPredecessors(), DataDependenceGraph::regRawSuccessors(), DataDependenceGraph::regWarSuccessors(), DataDependenceGraph::regWawSuccessors(), DataDependenceGraph::renamedSimpleLiveRange(), DataDependenceGraph::resultUsed(), DataDependenceGraph::sanityCheck(), DataDependenceGraph::sourceRenamed(), DataDependenceGraph::trueDependenceGraph(), PreOptimizer::tryToOptimizeAddressReg(), BUBasicBlockScheduler::tryToOptimizeWaw(), BasicBlockScheduler::tryToOptimizeWaw(), DataDependenceGraph::unMergeUser(), and BFMergeAndKeepUser::updateEdges().

◆ edgeReasonSt()

TCEString DataDependenceEdge::edgeReasonSt ( ) const
private

Helper method for creating the toString string.

Definition at line 235 of file DataDependenceEdge.cc.

235  {
236  switch (edgeReason_) {
237  case EDGE_REGISTER:
238  return "R";
239  case EDGE_MEMORY:
240  if (certainAlias())
241  return "M_T";
242  else
243  return "M";
244  case EDGE_FUSTATE:
245  return "F";
246  case EDGE_OPERATION:
247  return "O";
248  case EDGE_RA:
249  return "RA";
250  }
251  return "BUG";
252 }

References certainAlias(), EDGE_FUSTATE, EDGE_MEMORY, EDGE_OPERATION, EDGE_RA, EDGE_REGISTER, and edgeReason_.

Referenced by toString().

Here is the call graph for this function:

◆ guardSt()

TCEString DataDependenceEdge::guardSt ( ) const
private

Helper method for creating the toString string.

Definition at line 276 of file DataDependenceEdge.cc.

276  {
277  return guardUse() ? "_G" : "";
278 }

References guardUse().

Referenced by toString().

Here is the call graph for this function:

◆ guardUse()

bool DataDependenceEdge::guardUse ( ) const
inline

Definition at line 100 of file DataDependenceEdge.hh.

100  {
101  return edgeProperties_ & EPF_GUARD;
102  }

References edgeProperties_, and EPF_GUARD.

Referenced by CycleLookBackSoftwareBypasser::bypassNode(), PreOptimizer::checkGuardReversalAllowed(), CopyingDelaySlotFiller::checkIncomingDeps(), DataDependenceGraph::copyDepsOver(), DataDependenceGraph::copyIncomingGuardEdges(), DataDependenceGraph::copyIncomingRawEdges(), DataDependenceGraph::copyOutgoingGuardWarEdges(), DataDependenceGraph::destRenamed(), DataDependenceGraph::earliestCycle(), DataDependenceGraph::edgeLatency(), DataDependenceGraph::edgeWeight(), BF2Scheduler::findBypassEdge(), DataDependenceGraph::findBypassSource(), DataDependenceGraph::findLimitingAntidependenceDestination(), DataDependenceGraph::findLimitingAntidependenceSource(), DataDependenceGraph::findLiveRange(), RegisterCopyAdder::fixDDGEdgesInTempReg(), RegisterCopyAdder::fixDDGEdgesInTempRegChain(), RegisterCopyAdder::fixDDGEdgesInTempRegChainImmediate(), DataDependenceGraph::guardConverted(), DataDependenceGraph::guardDefMoves(), DataDependenceGraph::guardRawPredecessors(), DataDependenceGraph::guardRenamed(), DataDependenceGraph::guardRestored(), guardSt(), PreOptimizer::inverseGuardsOfHeads(), DataDependenceGraph::isLoopInvariant(), DataDependenceGraph::latestCycle(), DataDependenceGraph::mergeAndKeepSource(), DataDependenceGraph::mergeAndKeepUser(), DataDependenceGraph::onlyIncomingGuard(), DataDependenceGraph::onlyRegisterRawDestinations(), DataDependenceGraph::onlyRegisterRawSource(), operator==(), DataDependenceGraph::queueRawPredecessors(), DataDependenceGraph::removeIncomingGuardEdges(), DataDependenceGraph::removeOutgoingGuardWarEdges(), DataDependenceGraph::sourceRenamed(), PreOptimizer::tryToOptimizeAddressReg(), DataDependenceGraph::unMergeUser(), and BFMergeAndKeepUser::updateEdges().

◆ headPseudo()

bool DataDependenceEdge::headPseudo ( ) const
inline

◆ isBackEdge()

bool DataDependenceEdge::isBackEdge ( ) const
inlinevirtual

◆ isFalseDep()

bool DataDependenceEdge::isFalseDep ( ) const
inline

◆ isGPREdge()

bool DataDependenceEdge::isGPREdge ( ) const
inline

Definition at line 125 of file DataDependenceEdge.hh.

125  {
126  return edgeReason() == EDGE_REGISTER;
127  }

References EDGE_REGISTER, and edgeReason().

Here is the call graph for this function:

◆ isRAW()

bool DataDependenceEdge::isRAW ( ) const
inline

Definition at line 138 of file DataDependenceEdge.hh.

138  {
139  return dependenceType_ == DEP_RAW;
140  }

References DEP_RAW, and dependenceType_.

◆ isRegisterOrRA()

bool DataDependenceEdge::isRegisterOrRA ( ) const
inline

Definition at line 129 of file DataDependenceEdge.hh.

129  {
130  return edgeReason() == EDGE_REGISTER ||
131  edgeReason() == EDGE_RA;
132  }

References EDGE_RA, EDGE_REGISTER, and edgeReason().

Referenced by DataDependenceGraph::registerAndRAInEdges().

Here is the call graph for this function:

◆ isWAW()

bool DataDependenceEdge::isWAW ( ) const
inline

Definition at line 134 of file DataDependenceEdge.hh.

134  {
135  return dependenceType_ == DEP_WAW;
136  }

References DEP_WAW, and dependenceType_.

◆ latencySt()

TCEString DataDependenceEdge::latencySt ( MoveNode node) const
private

Helper method for creating the toString string. Finds out the latency of operation dependences.

Definition at line 294 of file DataDependenceEdge.cc.

294  {
295  if (edgeReason_ == EDGE_OPERATION && node.isAssigned()) {
296  if (node.move().isTriggering()) {
298  = dynamic_cast<TTAProgram::TerminalFUPort&>
299  (node.move().destination());
300  std::stringstream ss;
301  std::string lat;
302  ss << tfu.hwOperation()->latency();
303  ss >> lat;
304  return ":" + lat;
305  } else {
306  return ":0";
307  }
308  } else {
309  return "";
310  }
311 }

References TTAProgram::Move::destination(), EDGE_OPERATION, edgeReason_, TTAProgram::TerminalFUPort::hwOperation(), MoveNode::isAssigned(), TTAProgram::Move::isTriggering(), TTAMachine::HWOperation::latency(), and MoveNode::move().

Referenced by toString().

Here is the call graph for this function:

◆ loopDepth()

int DataDependenceEdge::loopDepth ( ) const
inline

◆ operator==()

bool DataDependenceEdge::operator== ( const DataDependenceEdge other) const

Comparator.

Checks whether the two edges are identical.

Definition at line 319 of file DataDependenceEdge.cc.

319  {
320  return dependenceType_ == other.dependenceType_ &&
321  edgeReason_ == other.edgeReason_ &&
322  data() == other.data() &&
323  guardUse() == other.guardUse() &&
324  certainAlias() == other.certainAlias() &&
325  tailPseudo() == other.tailPseudo() &&
326  headPseudo() == other.headPseudo() &&
327  isBackEdge() == other.isBackEdge();
328 }

References certainAlias(), data(), dependenceType_, edgeReason_, guardUse(), headPseudo(), isBackEdge(), and tailPseudo().

Here is the call graph for this function:

◆ printStats()

void DataDependenceEdge::printStats ( std::ostream &  out)
static

Prints statistics about the created edges to the given output stream.

Definition at line 191 of file DataDependenceEdge.cc.

191  {
192  out << "register anti-dependencies: " << regAntidepCount_ << std::endl;
193 }

References regAntidepCount_.

◆ pseudoSt()

TCEString DataDependenceEdge::pseudoSt ( ) const
private

Helper method for creating the toString string.

Definition at line 284 of file DataDependenceEdge.cc.

284  {
285  return TCEString(tailPseudo() ? "_TP" : "") + (headPseudo() ? "_HP" : "");
286 }

References headPseudo(), and tailPseudo().

Referenced by toString().

Here is the call graph for this function:

◆ saveState()

ObjectState * DataDependenceEdge::saveState ( const MoveNode tail,
const MoveNode head 
)

State dumping for XML generation.

Parameters
tailsource node of the edge
headsink node of the edge

Definition at line 345 of file DataDependenceEdge.cc.

347  {
348 
349  ObjectState* edgeOS = new ObjectState("edge");
350  ObjectState* tailOS = new ObjectState("nref", edgeOS);
351  ObjectState* headOS = new ObjectState("nref", edgeOS);
352  ObjectState* typeOS = new ObjectState("type", edgeOS);
353  ObjectState* reasonOS = new ObjectState("reason", edgeOS);
354 
355  tailOS->setValue(tail.nodeID());
356  headOS->setValue(head.nodeID());
357 
358  switch (dependenceType_) {
359  case DEP_UNKNOWN:
360  typeOS->setName("unknown");
361  break;
362  case DEP_RAW:
363  typeOS->setName("raw");
364  break;
365  case DEP_WAR:
366  typeOS->setName("war");
367  break;
368  case DEP_WAW:
369  typeOS->setName("waw");
370  break;
371  case DEP_TRIGGER:
372  typeOS->setName("trg");
373  break;
374  }
375 
376  switch (edgeReason_) {
377  case EDGE_REGISTER:
378  reasonOS->setName("reg");
379  break;
380  case EDGE_MEMORY:
381  reasonOS->setName("mem");
382  break;
383  case EDGE_FUSTATE:
384  reasonOS->setName("fu");
385  break;
386  case EDGE_OPERATION:
387  reasonOS->setName("op");
388  break;
389  case EDGE_RA:
390  reasonOS->setName("ra");
391  break;
392  }
393 
394  // Add operation latency information to trigger moves
395  if (tail.isMove() && tail.move().isTriggering()) {
397  = dynamic_cast<TTAProgram::TerminalFUPort&>
398  (tail.move().destination());
399 
400  ObjectState* latencyOS = new ObjectState("lat", edgeOS);
401  latencyOS->setValue(Conversion::toString(tfu.hwOperation()->latency()));
402  }
403 
404  if (loopEdge_ != 0) {
405  ObjectState* loopEdgeOS = new ObjectState("dist", edgeOS);
406  loopEdgeOS->setValue(Conversion::toString(static_cast<int>(loopEdge_)));
407  }
408 
409  return edgeOS;
410 }

References DEP_RAW, DEP_TRIGGER, DEP_UNKNOWN, DEP_WAR, DEP_WAW, dependenceType_, TTAProgram::Move::destination(), EDGE_FUSTATE, EDGE_MEMORY, EDGE_OPERATION, EDGE_RA, EDGE_REGISTER, edgeReason_, TTAProgram::TerminalFUPort::hwOperation(), MoveNode::isMove(), TTAProgram::Move::isTriggering(), TTAMachine::HWOperation::latency(), loopEdge_, MoveNode::move(), GraphNode::nodeID(), ObjectState::setName(), ObjectState::setValue(), and Conversion::toString().

Referenced by DataDependenceGraph::writeToXMLFile().

Here is the call graph for this function:

◆ setData()

void DataDependenceEdge::setData ( const TCEString newData)

Definition at line 331 of file DataDependenceEdge.cc.

331  {
332  delete[] data_;
333  data_ = new char[newData.length() + 1];
334  strncpy(data_, newData.c_str(), newData.length() + 1);
335 }

References data_.

Referenced by DataDependenceEdge(), DataDependenceGraph::destRenamed(), DataDependenceGraph::guardRenamed(), and DataDependenceGraph::sourceRenamed().

◆ tailPseudo()

bool DataDependenceEdge::tailPseudo ( ) const
inline

◆ toString() [1/2]

TCEString DataDependenceEdge::toString ( ) const
virtual

Returns a textual representation of the edge.

This is used in the generated dot files.

Reimplemented from GraphEdge.

Definition at line 201 of file DataDependenceEdge.cc.

201  {
202  if (loopEdge_ != 0) {
203  return TCEString("LOOP:") + Conversion::toString(int(loopEdge_)) + "_" +
204  edgeReasonSt() + guardSt() + depTypeSt() + pseudoSt() +
205  ':' + data();
206  }
207  return edgeReasonSt() + guardSt() + depTypeSt() + pseudoSt() + ':' + data();
208 }

References data(), depTypeSt(), edgeReasonSt(), guardSt(), loopEdge_, pseudoSt(), and Conversion::toString().

Referenced by ResourceConstraintAnalyzer::analyzeRegisterAntideps(), DataDependenceGraph::copyDepsOver(), DataDependenceGraph::dotString(), DataDependenceGraph::edgeLatency(), DataDependenceGraph::guardConverted(), BFRemoveEdge::operator()(), ProgramDependenceEdge::toString(), and BFRemoveEdge::undoOnlyMe().

Here is the call graph for this function:

◆ toString() [2/2]

TCEString DataDependenceEdge::toString ( MoveNode tail) const

Returns a textual representation of the edge.

Parameters
tailthe source node of the dependence. Needed for looking up operation latencies in scheduled code.
Todo:
This should be refactored.

This is used in the generated dot files.

Definition at line 221 of file DataDependenceEdge.cc.

221  {
222  if (loopEdge_ !=0) {
223  return TCEString("LOOP:") + Conversion::toString(int(loopEdge_)) +
224  "_" + edgeReasonSt() + guardSt() + depTypeSt() + pseudoSt() +
225  ':' + data() + latencySt(tail);
226  }
227  return edgeReasonSt() + guardSt() + depTypeSt() + pseudoSt() +
228  ':' + data() + latencySt(tail);
229 }

References data(), depTypeSt(), edgeReasonSt(), guardSt(), latencySt(), loopEdge_, pseudoSt(), and Conversion::toString().

Here is the call graph for this function:

Member Data Documentation

◆ data_

char* DataDependenceEdge::data_
private

Definition at line 181 of file DataDependenceEdge.hh.

Referenced by data(), DataDependenceEdge(), setData(), and ~DataDependenceEdge().

◆ dependenceType_

unsigned char DataDependenceEdge::dependenceType_
private

◆ edgeProperties_

unsigned char DataDependenceEdge::edgeProperties_
private

◆ edgeReason_

unsigned char DataDependenceEdge::edgeReason_
private

◆ loopEdge_

unsigned char DataDependenceEdge::loopEdge_
private

Definition at line 179 of file DataDependenceEdge.hh.

Referenced by DataDependenceEdge(), isBackEdge(), loopDepth(), saveState(), and toString().

◆ regAntidepCount_

int DataDependenceEdge::regAntidepCount_ = 0
static

Definition at line 154 of file DataDependenceEdge.hh.

Referenced by printStats().


The documentation for this class was generated from the following files:
DataDependenceEdge::edgeReasonSt
TCEString edgeReasonSt() const
Definition: DataDependenceEdge.cc:235
TTAProgram::Move::isTriggering
bool isTriggering() const
Definition: Move.cc:284
DataDependenceEdge::latencySt
TCEString latencySt(MoveNode &node) const
Definition: DataDependenceEdge.cc:294
DataDependenceEdge::DEP_TRIGGER
@ DEP_TRIGGER
Definition: DataDependenceEdge.hh:50
DataDependenceEdge::isBackEdge
bool isBackEdge() const
Definition: DataDependenceEdge.hh:118
DataDependenceEdge::pseudoSt
TCEString pseudoSt() const
Definition: DataDependenceEdge.cc:284
TTAProgram::Move::destination
Terminal & destination() const
Definition: Move.cc:323
GraphNode::nodeID
int nodeID() const
DataDependenceEdge::setData
void setData(const TCEString &newData)
Definition: DataDependenceEdge.cc:331
ObjectState
Definition: ObjectState.hh:59
DataDependenceEdge::EDGE_REGISTER
@ EDGE_REGISTER
Definition: DataDependenceEdge.hh:53
DataDependenceEdge::DependenceType
DependenceType
Definition: DataDependenceEdge.hh:45
ObjectState::setName
void setName(const std::string &name)
Conversion::toString
static std::string toString(const T &source)
DataDependenceEdge::tailPseudo
bool tailPseudo() const
Definition: DataDependenceEdge.hh:109
DataDependenceEdge::guardSt
TCEString guardSt() const
Definition: DataDependenceEdge.cc:276
DataDependenceEdge::edgeProperties_
unsigned char edgeProperties_
Definition: DataDependenceEdge.hh:178
assert
#define assert(condition)
Definition: Application.hh:86
DataDependenceEdge::DEP_UNKNOWN
@ DEP_UNKNOWN
Definition: DataDependenceEdge.hh:46
MoveNode::isMove
bool isMove() const
DataDependenceEdge::EPF_CERTAIN_ALIAS
@ EPF_CERTAIN_ALIAS
Definition: DataDependenceEdge.hh:171
DataDependenceEdge::DEP_RAW
@ DEP_RAW
Definition: DataDependenceEdge.hh:47
DataDependenceEdge::loopEdge_
unsigned char loopEdge_
Definition: DataDependenceEdge.hh:179
DataDependenceEdge::EDGE_FUSTATE
@ EDGE_FUSTATE
Definition: DataDependenceEdge.hh:55
DataDependenceEdge::EDGE_OPERATION
@ EDGE_OPERATION
Definition: DataDependenceEdge.hh:56
DataDependenceEdge::EPF_GUARD
@ EPF_GUARD
Definition: DataDependenceEdge.hh:170
DataDependenceEdge::certainAlias
bool certainAlias() const
Definition: DataDependenceEdge.hh:103
DataDependenceEdge::data
const TCEString data() const
Definition: DataDependenceEdge.hh:142
DataDependenceEdge::EPF_HEAD_PSEUDO
@ EPF_HEAD_PSEUDO
Definition: DataDependenceEdge.hh:173
DataDependenceEdge::DEP_WAW
@ DEP_WAW
Definition: DataDependenceEdge.hh:49
TTAProgram::TerminalFUPort
Definition: TerminalFUPort.hh:56
DataDependenceEdge::guardUse
bool guardUse() const
Definition: DataDependenceEdge.hh:100
DataDependenceEdge::dependenceType_
unsigned char dependenceType_
Definition: DataDependenceEdge.hh:176
MoveNode::move
TTAProgram::Move & move()
DataDependenceEdge::EDGE_MEMORY
@ EDGE_MEMORY
Definition: DataDependenceEdge.hh:54
TCEString
Definition: TCEString.hh:53
GraphEdge::GraphEdge
GraphEdge()
Definition: GraphEdge.cc:40
TTAProgram::TerminalFUPort::hwOperation
virtual const TTAMachine::HWOperation * hwOperation() const
Definition: TerminalFUPort.cc:379
TTAMachine::HWOperation::latency
int latency() const
Definition: HWOperation.cc:216
MoveNode::isAssigned
bool isAssigned() const
Definition: MoveNode.cc:367
DataDependenceEdge::headPseudo
bool headPseudo() const
Definition: DataDependenceEdge.hh:115
DataDependenceEdge::DEP_WAR
@ DEP_WAR
Definition: DataDependenceEdge.hh:48
DataDependenceEdge::EDGE_RA
@ EDGE_RA
Definition: DataDependenceEdge.hh:57
DataDependenceEdge::depTypeSt
TCEString depTypeSt() const
Definition: DataDependenceEdge.cc:258
ObjectState::setValue
void setValue(const std::string &value)
DataDependenceEdge::data_
char * data_
Definition: DataDependenceEdge.hh:181
DataDependenceEdge::EdgeReason
EdgeReason
Definition: DataDependenceEdge.hh:52
DataDependenceEdge::EPF_TAIL_PSEUDO
@ EPF_TAIL_PSEUDO
Definition: DataDependenceEdge.hh:172
DataDependenceEdge::edgeReason
EdgeReason edgeReason() const
Definition: DataDependenceEdge.hh:91
DataDependenceEdge::edgeReason_
unsigned char edgeReason_
Definition: DataDependenceEdge.hh:177
DataDependenceEdge::regAntidepCount_
static int regAntidepCount_
Definition: DataDependenceEdge.hh:154