OpenASIP
2.0
|
#include <BFRegCopy.hh>
Public Member Functions | |
BFRegCopy (BF2Scheduler &sched, MoveNode &mn, int lc) | |
bool | operator() () |
MoveNode * | getRegCopy () |
void | undoOnlyMe () |
void | undoDDG () |
void | createAntidepsForReg (MoveNode &firstMove, MoveNode &lastMove, const TTAMachine::RegisterFile &rf, int index, TCEString regName, BasicBlockNode &bbn, bool loopScheduling) |
Public Member Functions inherited from BFOptimization | |
BFOptimization (BF2Scheduler &sched) | |
virtual bool | isFinishFront () |
virtual void | mightBeReady (MoveNode &mn) |
Public Member Functions inherited from Reversible | |
virtual void | undo () |
virtual | ~Reversible () |
void | deleteChildren (std::stack< Reversible * > &children) |
int | id () |
Reversible () | |
Protected Member Functions | |
virtual bool | splitMove (BasicBlockNode &bbn)=0 |
virtual void | undoSplit ()=0 |
MoveNode * | createRegCopy (bool after) |
Protected Member Functions inherited from BFOptimization | |
DataDependenceGraph & | ddg () |
DataDependenceGraph * | rootDDG () |
const DataDependenceGraph & | ddg () const |
DataDependenceGraph * | prologDDG () |
SimpleResourceManager & | rm () const |
SimpleResourceManager * | prologRM () const |
BUMoveNodeSelector & | selector () |
const TTAMachine::Machine & | targetMachine () const |
unsigned int | ii () const |
MoveNodeDuplicator & | duplicator () const |
virtual bool | assign (int cycle, MoveNode &, const TTAMachine::Bus *bus=nullptr, const TTAMachine::FunctionUnit *srcFU_=nullptr, const TTAMachine::FunctionUnit *dstFU=nullptr, const TTAMachine::Bus *prologBus=nullptr, int immWriteCycle=-1, int prologImmWriteCycle=-1, const TTAMachine::ImmediateUnit *immu=nullptr, int immRegIndex=-1, bool ignoreGuardWriteCycle=false) |
virtual void | unassign (MoveNode &mn, bool disposePrologCopy=true) |
virtual int | rmEC (int cycle, MoveNode &mn, const TTAMachine::Bus *bus=nullptr, const TTAMachine::FunctionUnit *srcFU=nullptr, const TTAMachine::FunctionUnit *dstFU=nullptr, const TTAMachine::Bus *prologBus=nullptr, int immWriteCycle=-1, int prologImmWriteCycle=-1, const TTAMachine::ImmediateUnit *immu=nullptr, int immRegIndex=-1) |
virtual int | rmLC (int cycle, MoveNode &mn, const TTAMachine::Bus *bus=nullptr, const TTAMachine::FunctionUnit *srcFU=nullptr, const TTAMachine::FunctionUnit *dstFU=nullptr, const TTAMachine::Bus *prologBus=nullptr, int immWriteCycle=-1, int prologImmWriteCycle=-1, const TTAMachine::ImmediateUnit *immu=nullptr, int immRegIndex=-1) |
virtual bool | canAssign (int cycle, MoveNode &mn, const TTAMachine::Bus *bus=nullptr, const TTAMachine::FunctionUnit *srcFU=nullptr, const TTAMachine::FunctionUnit *dstFU=nullptr, const TTAMachine::Bus *prologBus=nullptr, int immWriteCycle=-1, int prologImmWriteCycle=-1, const TTAMachine::ImmediateUnit *immu=nullptr, int immRegIndex=-1, bool ignoreGWN=false) |
bool | putAlsoToPrologEpilog (int cycle, MoveNode &mn) |
void | setPrologSrcFUAnno (MoveNode &prologMN, MoveNode &loopMN) |
void | setPrologDstFUAnno (MoveNode &prologMN, MoveNode &loopMN) |
void | setJumpGuard (MoveNode &mn) |
void | unsetJumpGuard (MoveNode &mn) |
bool | needJumpGuard (const MoveNode &mn, int cycle) |
int | jumpGuardAvailableCycle (const MoveNode &mn) |
bool | canBeSpeculated (const Operation &op) |
bool | canBeSpeculated (const MoveNode &mn) |
bool | usePrologMove (const MoveNode &mn) |
bool | canBeScheduled (const MoveNode &mn) |
const TTAMachine::RegisterFile * | RFReadPortCountPreventsScheduling (const MoveNode &mn) |
bool | immCountPreventsScheduling (const MoveNode &mn) |
Protected Member Functions inherited from Reversible | |
bool | runPreChild (Reversible *preChild) |
bool | runPostChild (Reversible *preChild) |
bool | runChild (std::stack< Reversible * > &children, Reversible *child) |
bool | runChild (Reversible *child, bool pre) |
void | undoAndRemovePreChildren () |
void | undoAndRemovePostChildren () |
void | undoAndRemoveChildren (std::stack< Reversible * > &children) |
Protected Attributes | |
MoveNode & | mn_ |
MoveNode * | regCopy_ |
int | lc_ |
Protected Attributes inherited from BFOptimization | |
BF2Scheduler & | sched_ |
Protected Attributes inherited from Reversible | |
std::stack< Reversible * > | preChildren_ |
std::stack< Reversible * > | postChildren_ |
Additional Inherited Members | |
Static Public Member Functions inherited from BFOptimization | |
static void | clearPrologMoves () |
static MoveNode * | getSisterTrigger (const MoveNode &mn, const TTAMachine::Machine &mach) |
Static Protected Attributes inherited from BFOptimization | |
static std::map< MoveNode *, MoveNode *, MoveNode::Comparator > | prologMoves_ |
Definition at line 47 of file BFRegCopy.hh.
|
inline |
Definition at line 49 of file BFRegCopy.hh.
void BFRegCopy::createAntidepsForReg | ( | MoveNode & | firstMove, |
MoveNode & | lastMove, | ||
const TTAMachine::RegisterFile & | rf, | ||
int | index, | ||
TCEString | regName, | ||
BasicBlockNode & | bbn, | ||
bool | loopScheduling | ||
) |
Definition at line 99 of file BFRegCopy.cc.
References BasicBlockNode::basicBlock(), BFOptimization::ddg(), DataDependenceEdge::DEP_WAR, DataDependenceEdge::DEP_WAW, DataDependenceEdge::EDGE_REGISTER, DataDependenceGraph::firstScheduledRegisterWrites(), TTAProgram::Move::isUnconditional(), DataDependenceGraph::lastScheduledRegisterKill(), DataDependenceGraph::lastScheduledRegisterReads(), DataDependenceGraph::lastScheduledRegisterWrites(), TTAProgram::BasicBlock::liveRangeData_, MoveNode::move(), LiveRangeData::regDefines_, LiveRangeData::regFirstDefines_, LiveRangeData::regFirstUses_, LiveRangeData::regLastUses_, Reversible::runPostChild(), and BFOptimization::sched_.
Referenced by BFRegCopyAfter::splitMove(), and BFRegCopyBefore::splitMove().
|
protected |
|
inline |
Definition at line 52 of file BFRegCopy.hh.
References regCopy_.
Referenced by BFScheduleBU::operator()(), and BFScheduleExact::operator()().
|
virtual |
This performs the operation. Returns true if success, false if fail.
Implements Reversible.
Definition at line 52 of file BFRegCopy.cc.
References DataDependenceGraph::addNode(), TTAProgram::ProgramAnnotation::ANN_CONNECTIVITY_MOVE, TTAProgram::ProgramAnnotation::ANN_STACKFRAME_PROCEDURE_RETURN, TTAProgram::Move::copy(), BFOptimization::ddg(), DataDependenceGraph::getBasicBlockNode(), TTAProgram::Move::isReturn(), mn_, MoveNode::move(), regCopy_, TTAProgram::AnnotatedInstructionElement::setAnnotation(), splitMove(), and undoDDG().
|
protectedpure virtual |
Implemented in BFRegCopyBefore, BFRegCopyAfter, and BFCopyRegWithOp.
Referenced by operator()().
void BFRegCopy::undoDDG | ( | ) |
Definition at line 86 of file BFRegCopy.cc.
References assert, BFOptimization::ddg(), BF2Scheduler::deletingNode(), MoveNode::isScheduled(), mn_, regCopy_, DataDependenceGraph::removeNode(), BFOptimization::sched_, and MoveNode::toString().
Referenced by operator()(), and undoOnlyMe().
|
virtual |
Undoes the operations done by this class but not children. This method should be overloaded by most derived classes.
Reimplemented from Reversible.
Definition at line 81 of file BFRegCopy.cc.
References undoDDG(), and undoSplit().
|
protectedpure virtual |
Implemented in BFRegCopyBefore, BFRegCopyAfter, and BFCopyRegWithOp.
Referenced by undoOnlyMe().
|
protected |
Definition at line 71 of file BFRegCopy.hh.
Referenced by BFRegCopyAfter::splitMove().
|
protected |
Definition at line 69 of file BFRegCopy.hh.
Referenced by operator()(), BFCopyRegWithOp::splitMove(), BFRegCopyAfter::splitMove(), BFRegCopyBefore::splitMove(), undoDDG(), BFCopyRegWithOp::undoSplit(), BFRegCopyAfter::undoSplit(), and BFRegCopyBefore::undoSplit().
|
protected |
Definition at line 70 of file BFRegCopy.hh.
Referenced by getRegCopy(), operator()(), BFCopyRegWithOp::splitMove(), BFRegCopyAfter::splitMove(), BFRegCopyBefore::splitMove(), undoDDG(), BFCopyRegWithOp::undoSplit(), BFRegCopyAfter::undoSplit(), and BFRegCopyBefore::undoSplit().