OpenASIP  2.0
Public Member Functions | List of all members
BFDRELate Class Reference

#include <BFDRELate.hh>

Inheritance diagram for BFDRELate:
Inheritance graph
Collaboration diagram for BFDRELate:
Collaboration graph

Public Member Functions

 BFDRELate (BF2Scheduler &sched, MoveNode &mn)
 
virtual bool operator() ()
 
- Public Member Functions inherited from BFKillNode
 BFKillNode (BF2Scheduler &sched, MoveNode &mn)
 
bool operator() ()
 
void undoOnlyMe ()
 
- 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 ()
 

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 BFKillNode
DataDependenceGraph::EdgeSet createdEdges_
 
MoveNodemn_
 
- 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 40 of file BFDRELate.hh.

Constructor & Destructor Documentation

◆ BFDRELate()

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

Definition at line 42 of file BFDRELate.hh.

43  : BFKillNode(sched, mn) {}

Member Function Documentation

◆ operator()()

bool BFDRELate::operator() ( )
virtual

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

Implements Reversible.

Definition at line 42 of file BFDRELate.cc.

42  {
43  if (!sched_.killDeadResults() && !targetMachine().alwaysWriteResults()) {
44  return false;
45  }
46 
47  if (!ddg().resultUsed(mn_)) {
48 
49  // Take the predecssors of the dre'd src because their
50  // antideps may change
52 
53  createdEdges_ = ddg().copyDepsOver(mn_, true, false);
55  ddg().dropNode(mn_);
57 
58  // now mark antideps sources to be notified
59  for (auto n: pred) {
60  mightBeReady(*n);
61  }
62 
63 #ifdef DEBUG_BUBBLEFISH_SCHEDULER
64  std::cerr << "\t\t\tLate DRE ok: " << mn_.toString() << std::endl;
65 #endif
66  return true;
67  } else {
68  return false;
69  }
70 }

References assert, DataDependenceGraph::copyDepsOver(), BFKillNode::createdEdges_, BFOptimization::ddg(), BoostGraph< GraphNode, GraphEdge >::dropNode(), MoveNode::isScheduled(), BF2Scheduler::killDeadResults(), BFOptimization::mightBeReady(), BFKillNode::mn_, BF2Scheduler::nodeAndCopyKilled(), BoostGraph< GraphNode, GraphEdge >::predecessors(), BFOptimization::sched_, BFOptimization::targetMachine(), and MoveNode::toString().

Here is the call graph for this function:

The documentation for this class was generated from the following files:
BoostGraph::predecessors
virtual NodeSet predecessors(const Node &node, bool ignoreBackEdges=false, bool ignoreForwardEdges=false) const
MoveNode::toString
std::string toString() const
Definition: MoveNode.cc:576
BFKillNode::createdEdges_
DataDependenceGraph::EdgeSet createdEdges_
Definition: BFKillNode.hh:51
BF2Scheduler::killDeadResults
bool killDeadResults() const
Definition: BF2Scheduler.hh:110
BoostGraph< MoveNode, DataDependenceEdge >::NodeSet
std::set< MoveNode *, typename MoveNode ::Comparator > NodeSet
Definition: BoostGraph.hh:86
BoostGraph::dropNode
virtual void dropNode(Node &node)
BFOptimization::targetMachine
const TTAMachine::Machine & targetMachine() const
Definition: BFOptimization.cc:81
BFOptimization::sched_
BF2Scheduler & sched_
Definition: BFOptimization.hh:103
assert
#define assert(condition)
Definition: Application.hh:86
BF2Scheduler::nodeAndCopyKilled
void nodeAndCopyKilled(MoveNode &mn)
Definition: BF2Scheduler.cc:803
BFKillNode::BFKillNode
BFKillNode(BF2Scheduler &sched, MoveNode &mn)
Definition: BFKillNode.hh:46
BFOptimization::ddg
DataDependenceGraph & ddg()
Definition: BFOptimization.cc:70
BFKillNode::mn_
MoveNode & mn_
Definition: BFKillNode.hh:52
MoveNode::isScheduled
bool isScheduled() const
Definition: MoveNode.cc:409
DataDependenceGraph::copyDepsOver
EdgeSet copyDepsOver(MoveNode &node, bool anti, bool raw)
Definition: DataDependenceGraph.cc:2422
BFOptimization::mightBeReady
virtual void mightBeReady(MoveNode &mn)
Definition: BFOptimization.cc:953