OpenASIP  2.0
Public Member Functions | Public Attributes | List of all members
LiveRange Struct Reference

#include <LiveRange.hh>

Collaboration diagram for LiveRange:
Collaboration graph

Public Member Functions

bool noneScheduled () const
 
TCEString toString () const
 
int firstCycle () const
 
int lastCycle () const
 
void clear ()
 

Public Attributes

DataDependenceGraph::NodeSet writes
 
DataDependenceGraph::NodeSet reads
 
DataDependenceGraph::NodeSet guards
 

Detailed Description

Definition at line 38 of file LiveRange.hh.

Member Function Documentation

◆ clear()

void LiveRange::clear ( )

Definition at line 129 of file LiveRange.cc.

129  {
130  writes.clear();
131  reads.clear();
132  guards.clear();
133 }

References guards, reads, and writes.

Referenced by DataDependenceGraph::findLiveRange().

◆ firstCycle()

int LiveRange::firstCycle ( ) const

Definition at line 77 of file LiveRange.cc.

77  {
78  int fc = INT_MAX;
79  for (DataDependenceGraph::NodeSet::iterator i = writes.begin();
80  i != writes.end(); i++) {
81  if ((*i)->isScheduled()) {
82  fc = std::min(fc, (*i)->cycle());
83  }
84  }
85  for (DataDependenceGraph::NodeSet::iterator i = reads.begin();
86  i != reads.end(); i++) {
87  if ((*i)->isScheduled()) {
88  fc = std::min(fc, (*i)->cycle());
89 
90  }
91  }
92  for (DataDependenceGraph::NodeSet::iterator i = guards.begin();
93  i != guards.end(); i++) {
94  if ((*i)->isScheduled()) {
95  fc = std::min(fc, (*i)->cycle());
96 
97  }
98  }
99  return fc;
100 }

References guards, reads, and writes.

Referenced by RegisterRenamer::renameDestinationRegister().

◆ lastCycle()

int LiveRange::lastCycle ( ) const

Definition at line 103 of file LiveRange.cc.

103  {
104  int fc = -1;
105  for (DataDependenceGraph::NodeSet::iterator i = writes.begin();
106  i != writes.end(); i++) {
107  if ((*i)->isScheduled()) {
108  fc = std::max(fc, (*i)->cycle());
109  }
110  }
111  for (DataDependenceGraph::NodeSet::iterator i = reads.begin();
112  i != reads.end(); i++) {
113  if ((*i)->isScheduled()) {
114  fc = std::max(fc, (*i)->cycle());
115 
116  }
117  }
118  for (DataDependenceGraph::NodeSet::iterator i = guards.begin();
119  i != guards.end(); i++) {
120  if ((*i)->isScheduled()) {
121  fc = std::max(fc, (*i)->cycle());
122 
123  }
124  }
125  return fc;
126 }

References guards, reads, and writes.

Referenced by RegisterRenamer::renameSourceRegister().

◆ noneScheduled()

bool LiveRange::noneScheduled ( ) const

Definition at line 36 of file LiveRange.cc.

36  {
37  for (DataDependenceGraph::NodeSet::iterator i = writes.begin();
38  i != writes.end(); i++) {
39  if ((*i)->isScheduled()) {
40  return false;
41  }
42  }
43  for (DataDependenceGraph::NodeSet::iterator i = reads.begin();
44  i != reads.end(); i++) {
45  if ((*i)->isScheduled()) {
46  return false;
47  }
48  }
49  for (DataDependenceGraph::NodeSet::iterator i = guards.begin();
50  i != guards.end(); i++) {
51  if ((*i)->isScheduled()) {
52  return false;
53  }
54  }
55  return true;
56 }

References guards, reads, and writes.

Referenced by RegisterRenamer::renameDestinationRegister(), and RegisterRenamer::renameSourceRegister().

◆ toString()

TCEString LiveRange::toString ( ) const

Definition at line 59 of file LiveRange.cc.

59  {
60  TCEString rv;
61  for (DataDependenceGraph::NodeSet::iterator i = writes.begin();
62  i != writes.end(); i++) {
63  rv << (*i)->toString() << " ";
64  }
65  for (DataDependenceGraph::NodeSet::iterator i = reads.begin();
66  i != reads.end(); i++) {
67  rv << (*i)->toString() << " ";
68  }
69  for (DataDependenceGraph::NodeSet::iterator i = guards.begin();
70  i != guards.end(); i++) {
71  rv << (*i)->toString() << " ";
72  }
73  return rv;
74 }

References guards, reads, and writes.

Member Data Documentation

◆ guards

DataDependenceGraph::NodeSet LiveRange::guards

◆ reads

DataDependenceGraph::NodeSet LiveRange::reads

◆ writes

DataDependenceGraph::NodeSet LiveRange::writes

The documentation for this struct was generated from the following files:
LiveRange::writes
DataDependenceGraph::NodeSet writes
Definition: LiveRange.hh:39
LiveRange::reads
DataDependenceGraph::NodeSet reads
Definition: LiveRange.hh:40
LiveRange::guards
DataDependenceGraph::NodeSet guards
Definition: LiveRange.hh:41
TCEString
Definition: TCEString.hh:53