OpenASIP
2.0
|
#include <MoveNodeDuplicator.hh>
Public Member Functions | |
MoveNodeDuplicator (DataDependenceGraph &oldDDG, DataDependenceGraph &newDDG) | |
std::pair< MoveNode *, bool > | duplicateMoveNode (MoveNode &mn, bool addToDDG, bool ignoreSameBBBackEdges) |
std::shared_ptr< TTAProgram::Move > | duplicateMove (TTAProgram::Move &old) |
ProgramOperationPtr | duplicateProgramOperationPtr (ProgramOperationPtr old) |
void | disposeMoveNode (MoveNode *newMN) |
void | setBBN (BasicBlockNode &bbn) |
MoveNode * | getMoveNode (MoveNode &mn) |
ProgramOperationPtr | getProgramOperation (ProgramOperationPtr old) |
void | dumpDDG () |
Private Attributes | |
std::map< ProgramOperation *, ProgramOperationPtr, ProgramOperation::Comparator > | programOperations_ |
std::map< ProgramOperation *, ProgramOperationPtr, ProgramOperation::Comparator > | oldProgramOperations_ |
std::map< MoveNode *, MoveNode *, MoveNode::Comparator > | moveNodes_ |
std::map< MoveNode *, MoveNode *, MoveNode::Comparator > | oldMoveNodes_ |
std::map< TTAProgram::Move *, std::shared_ptr< TTAProgram::Move > > | moves_ |
BasicBlockNode * | bbn_ |
DataDependenceGraph * | oldDDG_ |
DataDependenceGraph * | newDDG_ |
DataDependenceGraph * | bigDDG_ |
Definition at line 38 of file MoveNodeDuplicator.hh.
MoveNodeDuplicator::MoveNodeDuplicator | ( | DataDependenceGraph & | oldDDG, |
DataDependenceGraph & | newDDG | ||
) |
This class is used for copying moves from a basic block to another corresponding basic block, copying also the programoperation structure.
Definition at line 48 of file MoveNodeDuplicator.cc.
void MoveNodeDuplicator::disposeMoveNode | ( | MoveNode * | newMN | ) |
Definition at line 53 of file MoveNodeDuplicator.cc.
References assert, BoostGraph< GraphNode, GraphEdge >::hasNode(), MoveNode::isScheduled(), MoveNode::move(), moveNodes_, moves_, newDDG_, oldMoveNodes_, DataDependenceGraph::removeNode(), and MoveNode::toString().
Referenced by BFOptimization::canAssign(), BFSchedulePreLoopShared::operator()(), BFDRELoop::operator()(), BFOptimization::rmEC(), BFOptimization::rmLC(), BFOptimization::unassignCopyFromPrologEpilog(), BFSchedulePreLoopShared::undoOnlyMe(), BFDRELoop::undoOnlyMe(), and BFMergeAndKeepUser::undoOnlyMe().
void MoveNodeDuplicator::dumpDDG | ( | ) |
Definition at line 273 of file MoveNodeDuplicator.cc.
References newDDG_, and GraphBase< GraphNode, GraphEdge >::writeToDotFile().
std::shared_ptr< TTAProgram::Move > MoveNodeDuplicator::duplicateMove | ( | TTAProgram::Move & | old | ) |
Definition at line 199 of file MoveNodeDuplicator.cc.
References TTAProgram::ProgramAnnotation::ANN_CONN_CANDIDATE_UNIT_DST, TTAProgram::ProgramAnnotation::ANN_CONN_CANDIDATE_UNIT_SRC, assert, AssocTools::containsKey(), TTAProgram::MoveGuard::copy(), TTAProgram::Move::copy(), TTAProgram::Move::destination(), MoveNode::destinationOperation(), TTAProgram::Terminal::functionUnit(), TTAProgram::Move::guard(), UniversalMachine::instance(), MoveNode::isDestinationOperation(), TTAProgram::Terminal::isFUPort(), TTAProgram::Terminal::isRA(), MoveNode::isScheduled(), MoveNode::isSourceOperation(), TTAProgram::Move::isUnconditional(), moves_, TTAMachine::Component::name(), Operation::name(), DataDependenceGraph::nodeOfMove(), oldDDG_, ProgramOperation::operation(), TTAProgram::Terminal::operationIndex(), TTAProgram::AnnotatedInstructionElement::setAnnotation(), TTAProgram::Move::setBus(), TTAProgram::Move::setDestination(), TTAProgram::Move::setGuard(), TTAProgram::Move::setSource(), TTAProgram::Move::source(), MoveNode::sourceOperation(), and UniversalMachine::universalFunctionUnit().
Referenced by duplicateMoveNode().
std::pair< MoveNode *, bool > MoveNodeDuplicator::duplicateMoveNode | ( | MoveNode & | old, |
bool | addToDDG, | ||
bool | ignoreSameBBBackEdges | ||
) |
Duplicates a corresponding MoveNode a given move in the next BB.
If no corresponding MoveNode created, creates one
old | ProgramOperation in jump target BB. |
Definition at line 106 of file MoveNodeDuplicator.cc.
References MoveNode::addDestinationOperationPtr(), ProgramOperation::addGuardOutputNode(), ProgramOperation::addInputNode(), DataDependenceGraph::addNode(), ProgramOperation::addOutputNode(), assert, bbn_, bigDDG_, AssocTools::containsKey(), DataDependenceGraph::copyDependencies(), MoveNode::destinationOperation(), MoveNode::destinationOperationCount(), MoveNode::destinationOperationPtr(), duplicateMove(), duplicateProgramOperationPtr(), MoveNode::guardOperation(), MoveNode::guardOperationPtr(), BoostGraph< GraphNode, GraphEdge >::hasNode(), MoveNode::isDestinationOperation(), MoveNode::isGuardOperation(), MoveNode::isSourceOperation(), MoveNode::move(), moveNodes_, newDDG_, oldMoveNodes_, MoveNode::setGuardOperationPtr(), MoveNode::setSourceOperationPtr(), MoveNode::sourceOperation(), and MoveNode::sourceOperationPtr().
Referenced by BFOptimization::canAssign(), BFOptimization::createCopyForPrologEpilog(), BFSchedulePreLoopShared::operator()(), BFDRELoop::operator()(), BFMergeAndKeepUser::operator()(), BFOptimization::rmEC(), and BFOptimization::rmLC().
ProgramOperationPtr MoveNodeDuplicator::duplicateProgramOperationPtr | ( | ProgramOperationPtr | old | ) |
Gets a corresponding ProgramOperation to a given move in the next BB.
If no corresponding ProgramOperation created, creates one
old | ProgramOperation in jump target BB. |
Definition at line 173 of file MoveNodeDuplicator.cc.
References AssocTools::containsKey(), oldProgramOperations_, and programOperations_.
Referenced by duplicateMoveNode(), and BFShareOperand::operator()().
Definition at line 85 of file MoveNodeDuplicator.cc.
References moveNodes_.
Referenced by BF2Scheduler::finalizeSchedule(), BFShareOperand::operator()(), BFPostpassLoopDRE::operator()(), BFShareOperandWithScheduled::operator()(), BFMergeAndKeepUser::operator()(), BFLateBypass::operator()(), BFRemoveGuardFromSucc::operator()(), BFShareOperandLate::operator()(), BFShareOperand::undoOnlyMe(), BFRemoveGuardFromSucc::undoOnlyMe(), and BFUnscheduleMove::unscheduleOriginal().
ProgramOperationPtr MoveNodeDuplicator::getProgramOperation | ( | ProgramOperationPtr | old | ) |
Definition at line 188 of file MoveNodeDuplicator.cc.
References programOperations_.
Referenced by BFShareOperand::operator()(), and BFShareOperand::undoOnlyMe().
|
inline |
Definition at line 52 of file MoveNodeDuplicator.hh.
References bbn_.
Referenced by BF2Scheduler::handleLoopDDG().
|
private |
Definition at line 77 of file MoveNodeDuplicator.hh.
Referenced by duplicateMoveNode(), and setBBN().
|
private |
Definition at line 80 of file MoveNodeDuplicator.hh.
Referenced by duplicateMoveNode().
|
private |
Definition at line 72 of file MoveNodeDuplicator.hh.
Referenced by disposeMoveNode(), duplicateMoveNode(), and getMoveNode().
|
private |
Definition at line 75 of file MoveNodeDuplicator.hh.
Referenced by disposeMoveNode(), and duplicateMove().
|
private |
Definition at line 79 of file MoveNodeDuplicator.hh.
Referenced by disposeMoveNode(), dumpDDG(), and duplicateMoveNode().
|
private |
Definition at line 78 of file MoveNodeDuplicator.hh.
Referenced by duplicateMove().
|
private |
Definition at line 74 of file MoveNodeDuplicator.hh.
Referenced by disposeMoveNode(), and duplicateMoveNode().
|
private |
Definition at line 70 of file MoveNodeDuplicator.hh.
Referenced by duplicateProgramOperationPtr().
|
private |
Definition at line 65 of file MoveNodeDuplicator.hh.
Referenced by duplicateProgramOperationPtr(), and getProgramOperation().