OpenASIP  2.0
Public Member Functions | Private Attributes | List of all members
BFRemoveGuard Class Reference

#include <BFRemoveGuard.hh>

Inheritance diagram for BFRemoveGuard:
Inheritance graph
Collaboration diagram for BFRemoveGuard:
Collaboration graph

Public Member Functions

 BFRemoveGuard (BF2Scheduler &sched, MoveNode &mn)
 
bool operator() () override
 
void undoOnlyMe () override
 
- 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 ()
 

Private Attributes

MoveNodemn_
 
TTAProgram::MoveGuardguard_
 

Additional Inherited Members

- Static Public Member Functions inherited from BFOptimization
static void clearPrologMoves ()
 
static MoveNodegetSisterTrigger (const MoveNode &mn, const TTAMachine::Machine &mach)
 
- Protected Member Functions inherited from BFOptimization
DataDependenceGraphddg ()
 
DataDependenceGraphrootDDG ()
 
const DataDependenceGraphddg () const
 
DataDependenceGraphprologDDG ()
 
SimpleResourceManagerrm () const
 
SimpleResourceManagerprologRM () const
 
BUMoveNodeSelectorselector ()
 
const TTAMachine::MachinetargetMachine () const
 
unsigned int ii () const
 
MoveNodeDuplicatorduplicator () 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::RegisterFileRFReadPortCountPreventsScheduling (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 inherited from BFOptimization
BF2Schedulersched_
 
- Protected Attributes inherited from Reversible
std::stack< Reversible * > preChildren_
 
std::stack< Reversible * > postChildren_
 
- Static Protected Attributes inherited from BFOptimization
static std::map< MoveNode *, MoveNode *, MoveNode::ComparatorprologMoves_
 

Detailed Description

Definition at line 51 of file BFRemoveGuard.hh.

Constructor & Destructor Documentation

◆ BFRemoveGuard()

BFRemoveGuard::BFRemoveGuard ( BF2Scheduler sched,
MoveNode mn 
)
inline

Definition at line 53 of file BFRemoveGuard.hh.

54  :
55  BFOptimization(sched), mn_(mn) {}

Member Function Documentation

◆ operator()()

bool BFRemoveGuard::operator() ( )
overridevirtual

This performs the operation. Returns true if success, false if fail.

Implements Reversible.

Definition at line 42 of file BFRemoveGuard.cc.

42  {
44 #ifdef DEBUG_BUBBLEFISH_SCHEDULER
45  std::cerr << "\t\t\tRemoving guard from move: "
46  << mn_.toString() << std::endl;
47 #endif
48 
49  // remove the guard edges from the ddg
50  auto inEdges = ddg().inEdges(mn_);
51  for (auto e: inEdges) {
52  if (e->guardUse() && !e->isFalseDep()) {
53  runPreChild(new BFRemoveEdge(sched_, ddg().tailNode(*e), mn_,*e));
54  }
55  }
56  auto outEdges = ddg().outEdges(mn_);
57  for (auto e: outEdges) {
58  if (e->guardUse() &&
59  e->dependenceType() == DataDependenceEdge::DEP_WAR) {
60  runPreChild(new BFRemoveEdge(sched_, mn_,ddg().headNode(*e), *e));
61  }
62  }
63 
64  guard_ = mn_.move().guard().copy();
65  mn_.move().setGuard(NULL);
66  return true;
67 }

References assert, TTAProgram::MoveGuard::copy(), BFOptimization::ddg(), DataDependenceEdge::DEP_WAR, TTAProgram::Move::guard(), guard_, BoostGraph< GraphNode, GraphEdge >::inEdges(), TTAProgram::Move::isUnconditional(), mn_, MoveNode::move(), BoostGraph< GraphNode, GraphEdge >::outEdges(), Reversible::runPreChild(), BFOptimization::sched_, TTAProgram::Move::setGuard(), and MoveNode::toString().

Here is the call graph for this function:

◆ undoOnlyMe()

void BFRemoveGuard::undoOnlyMe ( )
overridevirtual

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 69 of file BFRemoveGuard.cc.

69  {
71 }

References guard_, mn_, MoveNode::move(), and TTAProgram::Move::setGuard().

Here is the call graph for this function:

Member Data Documentation

◆ guard_

TTAProgram::MoveGuard* BFRemoveGuard::guard_
private

Definition at line 60 of file BFRemoveGuard.hh.

Referenced by operator()(), and undoOnlyMe().

◆ mn_

MoveNode& BFRemoveGuard::mn_
private

Definition at line 59 of file BFRemoveGuard.hh.

Referenced by operator()(), and undoOnlyMe().


The documentation for this class was generated from the following files:
MoveNode::toString
std::string toString() const
Definition: MoveNode.cc:576
TTAProgram::Move::isUnconditional
bool isUnconditional() const
Definition: Move.cc:154
TTAProgram::Move::setGuard
void setGuard(MoveGuard *guard)
Definition: Move.cc:360
BFRemoveGuard::mn_
MoveNode & mn_
Definition: BFRemoveGuard.hh:59
BFOptimization::sched_
BF2Scheduler & sched_
Definition: BFOptimization.hh:103
assert
#define assert(condition)
Definition: Application.hh:86
BFRemoveEdge
Definition: BFRemoveEdge.hh:40
TTAProgram::Move::guard
MoveGuard & guard() const
Definition: Move.cc:345
BFOptimization::ddg
DataDependenceGraph & ddg()
Definition: BFOptimization.cc:70
BoostGraph::inEdges
virtual EdgeSet inEdges(const Node &node) const
BFOptimization::BFOptimization
BFOptimization(BF2Scheduler &sched)
Definition: BFOptimization.hh:75
BoostGraph::outEdges
virtual EdgeSet outEdges(const Node &node) const
MoveNode::move
TTAProgram::Move & move()
Reversible::runPreChild
bool runPreChild(Reversible *preChild)
Definition: Reversible.cc:127
BFRemoveGuard::guard_
TTAProgram::MoveGuard * guard_
Definition: BFRemoveGuard.hh:60
TTAProgram::MoveGuard::copy
MoveGuard * copy() const
Definition: MoveGuard.cc:96
DataDependenceEdge::DEP_WAR
@ DEP_WAR
Definition: DataDependenceEdge.hh:48