OpenASIP
2.0
|
#include <CycleLookBackSoftwareBypasser.hh>
Public Member Functions | |
CycleLookBackSoftwareBypasser () | |
virtual | ~CycleLookBackSoftwareBypasser () |
virtual int | bypass (MoveNodeGroup &candidates, DataDependenceGraph &ddg, ResourceManager &rm, bool bypassTrigger) |
virtual void | removeBypass (MoveNodeGroup &candidates, DataDependenceGraph &ddg, ResourceManager &rm) |
virtual void | removeBypass (MoveNode &moveNode, DataDependenceGraph &ddg, ResourceManager &rm, bool restoreSource=true) |
virtual int | removeDeadResults (MoveNodeGroup &candidates, DataDependenceGraph &ddg, ResourceManager &rm, std::set< std::pair< TTAProgram::Move *, int > > &removedMoves) |
void | setSelector (MoveNodeSelector *selector) |
virtual void | clearCaches (DataDependenceGraph &ddg, bool removeDeadResults) |
Public Member Functions inherited from SoftwareBypasser | |
SoftwareBypasser () | |
virtual | ~SoftwareBypasser () |
int | bypassCount () |
int | deadResultCount () |
Static Public Member Functions | |
static void | printStats () |
Private Member Functions | |
int | bypassNode (MoveNode &nodeToBypass, int &lastOperandCycle, DataDependenceGraph &ddg, ResourceManager &rm) |
Private Attributes | |
int | cyclesToLookBack_ |
count of cycles before the operand write to look for the producer of the read value More... | |
int | cyclesToLookBackNoDRE_ |
count of cycles before the operand write to look for the producer of the read value when cannot kill result More... | |
bool | killDeadResults_ |
bool | bypassFromRegs_ |
bool | bypassToRegs_ |
std::map< MoveNode *, MoveNode *, MoveNode::Comparator > | storedSources_ |
Stores sources and bypassed moves in case they have to be unassigned (case when operands are scheduled and bypassed but result can not be scheduled with such operands. More... | |
std::map< MoveNode *, int > | sourceCycles_ |
std::map< MoveNode *, const TTAMachine::Bus * > | sourceBuses_ |
std::map< MoveNode *, MoveNode *, MoveNode::Comparator > | removedStoredSources_ |
DataDependenceGraph::NodeSet | removedNodes_ |
MoveNodeSelector * | selector_ |
Static Private Attributes | |
static int | bypassCount_ = 0 |
static int | deadResultCount_ = 0 |
static int | triggerAbortCount_ = 0 |
Additional Inherited Members | |
Protected Attributes inherited from SoftwareBypasser | |
int | bypassCount_ |
int | deadResultCount_ |
A simple implementation of software bypassing that reschedules operand writes as bypassed moves in case the result has been produced in n previous cycles.
Definition at line 52 of file CycleLookBackSoftwareBypasser.hh.
CycleLookBackSoftwareBypasser::CycleLookBackSoftwareBypasser | ( | ) |
Constructor.
Definition at line 62 of file CycleLookBackSoftwareBypasser.cc.
References SchedulerCmdLineOptions::bypassDistance(), Application::cmdLineOptions(), cyclesToLookBack_, cyclesToLookBackNoDRE_, SchedulerCmdLineOptions::killDeadResults(), killDeadResults_, and SchedulerCmdLineOptions::noDreBypassDistance().
|
virtual |
|
virtual |
Apply software bypassing to as many moves in the given MoveNodeGroup as possible.
This implementation works only if all operand writes have been scheduled. It tries to bypass all the operand write moves.
candidates | The moves to which apply software bypassing, if possible. |
ddg | The data dependence graph in which the movenodes belong to. |
rm | The resource manager which is used to check for resource availability. |
Implements SoftwareBypasser.
Definition at line 353 of file CycleLookBackSoftwareBypasser.cc.
References __func__, ResourceManager::assign(), bypassNode(), ResourceManager::canAssign(), MoveNode::cycle(), cyclesToLookBack_, ResourceManager::earliestCycle(), DataDependenceGraph::earliestCycle(), Exception::errorMessageStack(), MoveNode::guardLatency(), MoveNode::isBypass(), TTAProgram::Move::isControlFlowMove(), MoveNode::isDestinationOperation(), MoveNode::isScheduled(), MoveNode::isSourceOperation(), TTAProgram::Move::isTriggering(), TTAProgram::Move::isUnconditional(), DataDependenceGraph::latestCycle(), MoveNode::move(), MoveNodeGroup::node(), MoveNodeGroup::nodeCount(), triggerAbortCount_, and ResourceManager::unassign().
|
privatevirtual |
Tries to bypass a MoveNode.
moveNode | MoveNode to bypass. |
lastOperandCycle | in which contains last cycle of operands of the operation |
ddg | The data dependence graph in which the movenodes belong to. |
rm | The resource manager which is used to check for resource availability. |
Implements SoftwareBypasser.
Definition at line 98 of file CycleLookBackSoftwareBypasser.cc.
References __func__, TTAMachine::Machine::alwaysWriteResults(), TTAProgram::ProgramAnnotation::ANN_CONNECTIVITY_MOVE, assert, ResourceManager::assign(), TTAProgram::Move::bus(), bypassCount_, bypassFromRegs_, bypassToRegs_, ResourceManager::canAssign(), DataDependenceGraph::copyDepsOver(), MoveNode::cycle(), cyclesToLookBack_, cyclesToLookBackNoDRE_, DataDependenceEdge::DEP_RAW, DataDependenceEdge::DEP_WAR, DataDependenceEdge::dependenceType(), ResourceManager::earliestCycle(), DataDependenceGraph::earliestCycle(), DataDependenceEdge::EDGE_REGISTER, DataDependenceEdge::edgeReason(), MoveNode::guardLatency(), DataDependenceGraph::guardsAllowBypass(), DataDependenceEdge::guardUse(), TTAProgram::AnnotatedInstructionElement::hasAnnotations(), DataDependenceEdge::headPseudo(), BoostGraph< GraphNode, GraphEdge >::inEdges(), DataDependenceEdge::isBackEdge(), MoveNode::isDestinationOperation(), MoveNode::isDestinationVariable(), TTAProgram::Terminal::isImmediateRegister(), MoveNode::isScheduled(), MoveNode::isSourceConstant(), MoveNode::isSourceOperation(), TTAProgram::Move::isUnconditional(), killDeadResults_, TTAMachine::Component::machine(), DataDependenceGraph::mergeAndKeepUser(), MoveNode::move(), DataDependenceGraph::regRawSuccessorCount(), DataDependenceGraph::regWarSuccessors(), DataDependenceGraph::resultUsed(), BoostGraph< GraphNode, GraphEdge >::rootGraph(), TTAProgram::Move::setBus(), TTAProgram::Move::setSource(), TTAProgram::Move::source(), sourceBuses_, sourceCycles_, storedSources_, BoostGraph< GraphNode, GraphEdge >::tailNode(), ResourceManager::unassign(), and DataDependenceGraph::unMergeUser().
Referenced by bypass().
|
virtual |
Clears the storedSources data structure, when the old values in it are not needed anymore, allowing them to be deleted by the objects who own them.
Delete node from sourceCycles structure, as thesse are not deleted elsewhere.
Implements SoftwareBypasser.
Definition at line 769 of file CycleLookBackSoftwareBypasser.cc.
References removedNodes_, removedStoredSources_, BoostGraph< GraphNode, GraphEdge >::removeNode(), BoostGraph< GraphNode, GraphEdge >::rootGraph(), sourceBuses_, and storedSources_.
|
static |
Definition at line 788 of file CycleLookBackSoftwareBypasser.cc.
References bypassCount_, deadResultCount_, and triggerAbortCount_.
|
virtual |
Implements SoftwareBypasser.
Definition at line 543 of file CycleLookBackSoftwareBypasser.cc.
References assert, ResourceManager::assign(), bypassCount_, ResourceManager::canAssign(), MapTools::containsKey(), cyclesToLookBack_, MoveNode::isScheduled(), MoveNode::move(), removedStoredSources_, TTAProgram::Move::setBus(), sourceBuses_, sourceCycles_, storedSources_, ResourceManager::unassign(), and DataDependenceGraph::unMergeUser().
|
virtual |
Remove software bypassing from all moves in the given MoveNodeGroup if possible.
candidates | The moves from which to remove software bypassing, if possible. |
ddg | The data dependence grap in which the movenodes belong to. |
rm | The resource manager which is used to check for resource availability. |
Implements SoftwareBypasser.
Definition at line 515 of file CycleLookBackSoftwareBypasser.cc.
References cyclesToLookBack_, MoveNode::isScheduled(), MoveNodeGroup::node(), MoveNodeGroup::nodeCount(), and ResourceManager::unassign().
|
virtual |
Remove dead result moves for each bypassed move of given MoveNodeGroup if possible. That is, no other result reads of result exists. This assumes that result moves in MoveNodeGroup are also scheduled.
candidates | The moves for which remove dead result writes |
ddg | The data dependence grap in which the movenodes belong to. |
rm | The resource manager which is used to check for resource availability. |
removedMoves | The dead result eliminated moves and their original cycles, to allow rescheduling of moves that were previously resource (RF write port usually) constrained by the removed moves. |
Implements SoftwareBypasser.
Definition at line 600 of file CycleLookBackSoftwareBypasser.cc.
References assert, MapTools::containsKey(), deadResultCount_, TTAProgram::Move::destination(), BoostGraph< GraphNode, GraphEdge >::dropNode(), TTAProgram::Terminal::equals(), BoostGraph< GraphNode, GraphEdge >::hasNode(), MoveNode::isScheduled(), MoveNodeSelector::mightBeReady(), MoveNode::move(), MoveNodeGroup::node(), MoveNodeGroup::nodeCount(), DataDependenceGraph::regWawSuccessors(), removedNodes_, removedStoredSources_, BoostGraph< GraphNode, GraphEdge >::rootGraph(), selector_, TTAProgram::Move::source(), sourceCycles_, storedSources_, BoostGraph< GraphNode, GraphEdge >::successors(), and ResourceManager::unassign().
|
virtual |
Reimplemented from SoftwareBypasser.
Definition at line 756 of file CycleLookBackSoftwareBypasser.cc.
References selector_.
|
staticprivate |
Definition at line 125 of file CycleLookBackSoftwareBypasser.hh.
Referenced by bypassNode(), printStats(), and removeBypass().
|
private |
Definition at line 96 of file CycleLookBackSoftwareBypasser.hh.
Referenced by bypassNode().
|
private |
Definition at line 99 of file CycleLookBackSoftwareBypasser.hh.
Referenced by bypassNode().
|
private |
count of cycles before the operand write to look for the producer of the read value
Definition at line 86 of file CycleLookBackSoftwareBypasser.hh.
Referenced by bypass(), bypassNode(), CycleLookBackSoftwareBypasser(), and removeBypass().
|
private |
count of cycles before the operand write to look for the producer of the read value when cannot kill result
Definition at line 90 of file CycleLookBackSoftwareBypasser.hh.
Referenced by bypassNode(), and CycleLookBackSoftwareBypasser().
|
staticprivate |
Definition at line 126 of file CycleLookBackSoftwareBypasser.hh.
Referenced by printStats(), and removeDeadResults().
|
private |
Definition at line 93 of file CycleLookBackSoftwareBypasser.hh.
Referenced by bypassNode(), and CycleLookBackSoftwareBypasser().
|
private |
Definition at line 121 of file CycleLookBackSoftwareBypasser.hh.
Referenced by clearCaches(), and removeDeadResults().
|
private |
Definition at line 117 of file CycleLookBackSoftwareBypasser.hh.
Referenced by clearCaches(), removeBypass(), and removeDeadResults().
|
private |
Definition at line 123 of file CycleLookBackSoftwareBypasser.hh.
Referenced by removeDeadResults(), and setSelector().
|
private |
Definition at line 115 of file CycleLookBackSoftwareBypasser.hh.
Referenced by bypassNode(), clearCaches(), and removeBypass().
|
private |
Definition at line 114 of file CycleLookBackSoftwareBypasser.hh.
Referenced by bypassNode(), removeBypass(), and removeDeadResults().
|
private |
Stores sources and bypassed moves in case they have to be unassigned (case when operands are scheduled and bypassed but result can not be scheduled with such operands.
Definition at line 111 of file CycleLookBackSoftwareBypasser.hh.
Referenced by bypassNode(), clearCaches(), removeBypass(), and removeDeadResults().
|
staticprivate |
Definition at line 127 of file CycleLookBackSoftwareBypasser.hh.
Referenced by bypass(), and printStats().