OpenASIP
2.0
|
#include <BFSwapOperands.hh>
Public Member Functions | |
BFSwapOperands (BF2Scheduler &sched, MoveNode &mn) | |
BFSwapOperands (BF2Scheduler &sched, ProgramOperationPtr po, MoveNode &mn1, MoveNode &mn2) | |
virtual bool | operator() () |
virtual | ~BFSwapOperands () |
std::pair< MoveNode *, MoveNode * > | switchedMNs () |
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 void | undoOnlyMe () |
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 | |
std::pair< MoveNode *, MoveNode * > | switched_ |
ProgramOperationPtr | poPtr_ |
int | idx1_ |
int | idx2_ |
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 41 of file BFSwapOperands.hh.
BFSwapOperands::BFSwapOperands | ( | BF2Scheduler & | sched, |
MoveNode & | trigger | ||
) |
Tries to switch operand and trigger so that it makees immediates triggers, but minimizes the critical path if both operands come from variables.
Definition at line 56 of file BFSwapOperands.cc.
References MoveNodeSet::at(), Operation::canSwap(), MoveNodeSet::count(), TTAProgram::Move::destination(), MoveNode::destinationOperationCount(), MoveNode::destinationOperationPtr(), idx1_, idx2_, TTAProgram::Terminal::isImmediate(), BF2Scheduler::isPreLoopSharedOperand(), MoveNode::isScheduled(), MoveNode::move(), Operation::numberOfInputs(), TTAProgram::Terminal::operationIndex(), poPtr_, BFOptimization::sched_, TTAProgram::Move::source(), switched_, and MoveNode::toString().
BFSwapOperands::BFSwapOperands | ( | BF2Scheduler & | sched, |
ProgramOperationPtr | po, | ||
MoveNode & | mn1, | ||
MoveNode & | mn2 | ||
) |
Definition at line 45 of file BFSwapOperands.cc.
|
inlinevirtual |
Definition at line 48 of file BFSwapOperands.hh.
|
virtual |
This performs the operation. Returns true if success, false if fail.
Implements Reversible.
Definition at line 137 of file BFSwapOperands.cc.
References Operation::canSwap(), idx1_, idx2_, and poPtr_.
Definition at line 49 of file BFSwapOperands.hh.
References switched_.
Referenced by BF2ScheduleFront::getMoveNodeFromFrontBU().
|
protectedvirtual |
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 158 of file BFSwapOperands.cc.
|
protected |
Definition at line 54 of file BFSwapOperands.hh.
Referenced by BFSwapOperands(), operator()(), and undoOnlyMe().
|
protected |
Definition at line 55 of file BFSwapOperands.hh.
Referenced by BFSwapOperands(), operator()(), and undoOnlyMe().
|
protected |
Definition at line 53 of file BFSwapOperands.hh.
Referenced by BFSwapOperands(), operator()(), and undoOnlyMe().
Definition at line 52 of file BFSwapOperands.hh.
Referenced by BFSwapOperands(), and switchedMNs().