OpenASIP
2.0
|
#include <ControlDependenceNode.hh>
Public Types | |
enum | NodeType { CDEP_NODE_REGION, CDEP_NODE_PREDICATE, CDEP_NODE_BB, CDEP_NODE_LOOPENTRY, CDEP_NODE_LOOPCLOSE } |
typedef std::set< ControlDependenceNode * > | NodesInfo |
Storage type for other nodes of same graph needed to define some non graph relations. Duplicit type compared to NodeSet, but that is defined in Graph class. More... | |
Public Member Functions | |
ControlDependenceNode (const NodeType type=CDEP_NODE_BB, BasicBlockNode *bblock=NULL) | |
virtual | ~ControlDependenceNode () |
bool | isControlDependenceNode () const |
bool | isRegionNode () const |
bool | isPredicateNode () const |
bool | isBBNode () const |
bool | isEntryNode () const |
bool | isExitNode () const |
bool | isLoopEntryNode () const |
bool | isLoopEntryNode (int component) const |
bool | isLoopCloseNode () const |
void | setLoopEntryNode (int component) |
void | setComponent (int component) |
int | component () const |
void | setLastNode () |
LastNode marks node that must be ordered last compared to it's sibling nodes - Close node of loop. More... | |
bool | isLastNode () const |
int | instructionCount () const |
TTAProgram::Instruction & | instruction (int index) const |
BasicBlockNode * | basicBlockNode () const |
NodeType | type () const |
std::string | toString () const |
void | addToRegion (ControlDependenceNode &node) |
const NodesInfo & | region () |
void | addToEEC (ControlDependenceNode &node) |
const NodesInfo & | eec () |
void | addToPseudoPredicateEEC (ControlDependenceNode &node) |
const NodesInfo & | pseudoPredicateEEC () |
void | printRelations () const |
Public Member Functions inherited from GraphNode | |
GraphNode (int nodeID) | |
GraphNode () | |
virtual | ~GraphNode () |
virtual GraphNode * | clone () const |
int | nodeID () const |
virtual std::string | dotString () const |
Private Attributes | |
NodeType | type_ |
BasicBlockNode * | code_ |
NodesInfo | region_ |
Stores "region" information for computing serialization information. More... | |
NodesInfo | eec_ |
Stores "eec" information for computing serialization information. More... | |
NodesInfo | pseudoPredicateEEC_ |
Stores "shadow" eec information for predicate basic blocks which can be then copied into PDG for nodes of basic blocks that are not actuall predicate node. More... | |
int | component_ |
Number of strong component the node belongs to, if any. More... | |
bool | lastNode_ |
Indicated that the node should be scheduled last from it's siblings Case when node is predicate or region, has close node in it's subgraph and ancestor which is loop entry node. More... | |
Node of the control dependence graph. Each node represents one basic block or region node.
A basic block is defined as an ordered sequence of adjacent instructions in which only the first can be target of jump and ony the last one (save jump delay slots) can contain jumps.
Definition at line 61 of file ControlDependenceNode.hh.
typedef std::set<ControlDependenceNode*> ControlDependenceNode::NodesInfo |
Storage type for other nodes of same graph needed to define some non graph relations. Duplicit type compared to NodeSet, but that is defined in Graph class.
Definition at line 73 of file ControlDependenceNode.hh.
Enumerator | |
---|---|
CDEP_NODE_REGION | |
CDEP_NODE_PREDICATE | |
CDEP_NODE_BB | |
CDEP_NODE_LOOPENTRY | |
CDEP_NODE_LOOPCLOSE |
Definition at line 63 of file ControlDependenceNode.hh.
|
inline |
Definition at line 74 of file ControlDependenceNode.hh.
|
virtual |
Destructor.
Definition at line 44 of file ControlDependenceNode.cc.
References eec_, pseudoPredicateEEC_, and region_.
void ControlDependenceNode::addToEEC | ( | ControlDependenceNode & | node | ) |
Add CDG node to "eec" set for computing serialization information
node | Control Dependence Node to add to the set |
Definition at line 232 of file ControlDependenceNode.cc.
References eec_.
Referenced by ControlDependenceGraph::computeEECInfo().
void ControlDependenceNode::addToPseudoPredicateEEC | ( | ControlDependenceNode & | node | ) |
Add CDG node to "pseduo eec" set for computing serialization information case node is predicate basic block. Only actuall predicate move will have predicate eec, rest of moves of basic block needs regular 'leaf' eec computation
node | Control Dependence Node to add to the set |
Definition at line 257 of file ControlDependenceNode.cc.
References pseudoPredicateEEC_.
Referenced by ControlDependenceGraph::computeEECInfo().
void ControlDependenceNode::addToRegion | ( | ControlDependenceNode & | node | ) |
Add CDG node to "region" set for computing serialization information
node | Control Dependence Node to add to the set |
Definition at line 212 of file ControlDependenceNode.cc.
References region_.
Referenced by ControlDependenceGraph::computeRegionInfo().
BasicBlockNode * ControlDependenceNode::basicBlockNode | ( | ) | const |
Returns a basic block refered by the control dependence node
Definition at line 116 of file ControlDependenceNode.cc.
References __func__, code_, isBBNode(), and isPredicateNode().
Referenced by ProgramDependenceGraph::ProgramDependenceGraph().
|
inline |
Definition at line 91 of file ControlDependenceNode.hh.
References component_.
Referenced by ControlDependenceGraph::computeEECInfo(), ControlDependenceGraph::computeRegionInfo(), ProgramDependenceGraph::copyRegionEECComponent(), isLoopEntryNode(), setComponent(), and setLoopEntryNode().
const ControlDependenceNode::NodesInfo & ControlDependenceNode::eec | ( | ) |
Returns the "eec" set for given node
Definition at line 243 of file ControlDependenceNode.cc.
References eec_.
Referenced by ControlDependenceGraph::computeEECInfo(), and ProgramDependenceGraph::copyRegionEECComponent().
TTAProgram::Instruction & ControlDependenceNode::instruction | ( | int | index | ) | const |
Returns instruction at given index in basic block.
index | Index of instruction in basic block |
Definition at line 56 of file ControlDependenceNode.cc.
References __func__, BasicBlockNode::basicBlock(), code_, TTAProgram::CodeSnippet::instructionAtIndex(), isBBNode(), and toString().
int ControlDependenceNode::instructionCount | ( | ) | const |
Returns number of instructions in basic block
Definition at line 130 of file ControlDependenceNode.cc.
References __func__, BasicBlockNode::basicBlock(), code_, TTAProgram::CodeSnippet::instructionCount(), and isBBNode().
bool ControlDependenceNode::isBBNode | ( | ) | const |
Predicate nodes are BB which ends with conditional jump in CFG
Definition at line 155 of file ControlDependenceNode.cc.
References CDEP_NODE_BB, isPredicateNode(), and type_.
Referenced by basicBlockNode(), ControlDependenceGraph::eliminateMultipleOutputs(), instruction(), instructionCount(), and toString().
bool ControlDependenceNode::isControlDependenceNode | ( | ) | const |
Definition at line 140 of file ControlDependenceNode.cc.
bool ControlDependenceNode::isEntryNode | ( | ) | const |
Definition at line 161 of file ControlDependenceNode.cc.
References CDEP_NODE_BB, code_, BasicBlockNode::isEntryBB(), and type_.
Referenced by ControlDependenceGraph::entryNode(), ProgramDependenceGraph::ProgramDependenceGraph(), setLoopEntryNode(), and toString().
bool ControlDependenceNode::isExitNode | ( | ) | const |
Definition at line 166 of file ControlDependenceNode.cc.
References CDEP_NODE_BB, code_, BasicBlockNode::isExitBB(), and type_.
Referenced by toString().
|
inline |
Definition at line 95 of file ControlDependenceNode.hh.
References lastNode_.
Referenced by ProgramDependenceGraph::copyRegionEECComponent(), ProgramDependenceGraph::ProgramDependenceGraph(), and toString().
bool ControlDependenceNode::isLoopCloseNode | ( | ) | const |
Definition at line 181 of file ControlDependenceNode.cc.
References CDEP_NODE_LOOPCLOSE, and type_.
Referenced by ControlDependenceGraph::computeEECInfo(), ProgramDependenceGraph::ProgramDependenceGraph(), ProgramDependenceGraph::removeGuardedJump(), and toString().
bool ControlDependenceNode::isLoopEntryNode | ( | ) | const |
Definition at line 171 of file ControlDependenceNode.cc.
References CDEP_NODE_LOOPENTRY, and type_.
Referenced by ControlDependenceGraph::computeRegionInfo(), ControlDependenceGraph::computeRelations(), ProgramDependenceGraph::ProgramDependenceGraph(), ProgramDependenceGraph::removeGuardedJump(), and toString().
bool ControlDependenceNode::isLoopEntryNode | ( | int | component | ) | const |
Definition at line 176 of file ControlDependenceNode.cc.
References CDEP_NODE_LOOPENTRY, component(), component_, and type_.
bool ControlDependenceNode::isPredicateNode | ( | ) | const |
Definition at line 150 of file ControlDependenceNode.cc.
References CDEP_NODE_PREDICATE, and type_.
Referenced by basicBlockNode(), ControlDependenceGraph::computeEECInfo(), ControlDependenceGraph::computeRelations(), ProgramDependenceGraph::copyRegionEECComponent(), isBBNode(), and toString().
bool ControlDependenceNode::isRegionNode | ( | ) | const |
Definition at line 145 of file ControlDependenceNode.cc.
References CDEP_NODE_REGION, and type_.
Referenced by ControlDependenceGraph::computeRelations(), ProgramDependenceGraph::ProgramDependenceGraph(), ProgramDependenceGraph::removeGuardedJump(), setLoopEntryNode(), and toString().
void ControlDependenceNode::printRelations | ( | ) | const |
Definition at line 273 of file ControlDependenceNode.cc.
References eec_, Application::logStream(), and region_.
const ControlDependenceNode::NodesInfo & ControlDependenceNode::pseudoPredicateEEC | ( | ) |
Returns the "pseudo eec" set for given node, applicable for predicate nodes
Definition at line 268 of file ControlDependenceNode.cc.
References pseudoPredicateEEC_.
Referenced by ProgramDependenceGraph::copyRegionEECComponent().
const ControlDependenceNode::NodesInfo & ControlDependenceNode::region | ( | ) |
Returns the "region" set for given node
Definition at line 222 of file ControlDependenceNode.cc.
References region_.
Referenced by ControlDependenceGraph::computeEECInfo(), ControlDependenceGraph::computeRegionInfo(), and ProgramDependenceGraph::copyRegionEECComponent().
|
inline |
Definition at line 90 of file ControlDependenceNode.hh.
References component(), and component_.
|
inline |
LastNode marks node that must be ordered last compared to it's sibling nodes - Close node of loop.
Definition at line 94 of file ControlDependenceNode.hh.
References lastNode_.
void ControlDependenceNode::setLoopEntryNode | ( | int | component | ) |
In case node was previously in other component as regular region, mark it as loop entry of current component
Definition at line 186 of file ControlDependenceNode.cc.
References __func__, CDEP_NODE_LOOPENTRY, component(), component_, isEntryNode(), isRegionNode(), toString(), and type_.
|
virtual |
Returns the type of basic block as string.
Reimplemented from GraphNode.
Definition at line 72 of file ControlDependenceNode.cc.
References code_, isBBNode(), isEntryNode(), isExitNode(), isLastNode(), isLoopCloseNode(), isLoopEntryNode(), isPredicateNode(), isRegionNode(), GraphNode::nodeID(), Conversion::toString(), and BasicBlockNode::toString().
Referenced by ControlDependenceGraph::computeEECInfo(), ControlDependenceGraph::entryNode(), instruction(), ControlDependenceGraph::regionHelper(), setLoopEntryNode(), and ProgramDependenceNode::toString().
ControlDependenceNode::NodeType ControlDependenceNode::type | ( | ) | const |
Definition at line 202 of file ControlDependenceNode.cc.
References type_.
|
private |
Definition at line 116 of file ControlDependenceNode.hh.
Referenced by basicBlockNode(), instruction(), instructionCount(), isEntryNode(), isExitNode(), and toString().
|
private |
Number of strong component the node belongs to, if any.
Definition at line 126 of file ControlDependenceNode.hh.
Referenced by component(), isLoopEntryNode(), setComponent(), and setLoopEntryNode().
|
private |
Stores "eec" information for computing serialization information.
Definition at line 120 of file ControlDependenceNode.hh.
Referenced by addToEEC(), eec(), printRelations(), and ~ControlDependenceNode().
|
private |
Indicated that the node should be scheduled last from it's siblings Case when node is predicate or region, has close node in it's subgraph and ancestor which is loop entry node.
Definition at line 130 of file ControlDependenceNode.hh.
Referenced by isLastNode(), and setLastNode().
|
private |
Stores "shadow" eec information for predicate basic blocks which can be then copied into PDG for nodes of basic blocks that are not actuall predicate node.
Definition at line 124 of file ControlDependenceNode.hh.
Referenced by addToPseudoPredicateEEC(), pseudoPredicateEEC(), and ~ControlDependenceNode().
|
private |
Stores "region" information for computing serialization information.
Definition at line 118 of file ControlDependenceNode.hh.
Referenced by addToRegion(), printRelations(), region(), and ~ControlDependenceNode().
|
private |
Definition at line 115 of file ControlDependenceNode.hh.
Referenced by isBBNode(), isEntryNode(), isExitNode(), isLoopCloseNode(), isLoopEntryNode(), isPredicateNode(), isRegionNode(), setLoopEntryNode(), and type().