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

#include <BFEarlyBypass.hh>

Inheritance diagram for BFEarlyBypass:
Inheritance graph
Collaboration diagram for BFEarlyBypass:
Collaboration graph

Public Member Functions

 BFEarlyBypass (BF2Scheduler &sched, MoveNode &src, 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

MoveNodesrc_
 
MoveNodedst_
 

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 39 of file BFEarlyBypass.hh.

Constructor & Destructor Documentation

◆ BFEarlyBypass()

BFEarlyBypass::BFEarlyBypass ( BF2Scheduler sched,
MoveNode src,
MoveNode mn 
)
inline

Definition at line 41 of file BFEarlyBypass.hh.

41  :
42  BFOptimization(sched), src_(src), dst_(mn) {}

Member Function Documentation

◆ operator()()

bool BFEarlyBypass::operator() ( )
overridevirtual

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

Implements Reversible.

Definition at line 52 of file BFEarlyBypass.cc.

52  {
53 
54 #ifdef DEBUG_LOOP_SCHEDULER
55  if (ii() != 0) {
56  std::cerr << "\t\t\tEarly bypass for: " << src_.toString()
57  << " to " << dst_.toString() << std::endl;
58  }
59 #endif
60  // Take the predecssors so that they can be notified because their
61  // antideps may change
63 
66  return false;
67  }
68 
69  // if alwayswriteresults, then must have exactly one result write.
70  if (targetMachine().alwaysWriteResults()) {
71  // if destination is variable, we have two variable writes. MUST DRE.
73  BFDREEarly* dre = new BFDREEarly(sched_,src_);
74  if (!runPostChild(dre)) {
75  undo();
76  return false;
77  }
78  }
79  // if destination is not variable, must NOT DRE.
80  } else {
81  BFDREEarly* dre = new BFDREEarly(sched_,src_);
82  runPostChild(dre);
83  }
85 #ifdef DEBUG_BUBBLEFISH_SCHEDULER
86  std::cerr << "\t\tEarly bypass ok for: " << dst_.toString() << std::endl;
87 #endif
88 
89  // now notify antideps sources
90  for (auto i : pred) {
91  mightBeReady(*i);
92  }
93 
94  return true;
95 }

References assert, BF2ScheduleFront::bypassed(), BF2Scheduler::currentFront(), BFOptimization::ddg(), dst_, BFOptimization::ii(), MoveNode::isDestinationVariable(), MoveNode::isScheduled(), BFOptimization::mightBeReady(), BoostGraph< GraphNode, GraphEdge >::predecessors(), Reversible::runPostChild(), Reversible::runPreChild(), BFOptimization::sched_, src_, BFOptimization::targetMachine(), MoveNode::toString(), and Reversible::undo().

Here is the call graph for this function:

◆ undoOnlyMe()

void BFEarlyBypass::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 98 of file BFEarlyBypass.cc.

98  {
100 }

References BF2Scheduler::currentFront(), dst_, BFOptimization::sched_, src_, and BF2ScheduleFront::undidBypass().

Here is the call graph for this function:

Member Data Documentation

◆ dst_

MoveNode& BFEarlyBypass::dst_
private

Definition at line 47 of file BFEarlyBypass.hh.

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

◆ src_

MoveNode& BFEarlyBypass::src_
private

Definition at line 46 of file BFEarlyBypass.hh.

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


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::isDestinationVariable
bool isDestinationVariable() const
Definition: MoveNode.cc:264
MoveNode::toString
std::string toString() const
Definition: MoveNode.cc:576
BFOptimization::ii
unsigned int ii() const
Definition: BFOptimization.cc:85
BoostGraph< MoveNode, DataDependenceEdge >::NodeSet
std::set< MoveNode *, typename MoveNode ::Comparator > NodeSet
Definition: BoostGraph.hh:86
BF2ScheduleFront::undidBypass
void undidBypass(MoveNode &, MoveNode &dst)
Definition: BF2ScheduleFront.hh:67
BFEarlyBypass::dst_
MoveNode & dst_
Definition: BFEarlyBypass.hh:47
BFOptimization::targetMachine
const TTAMachine::Machine & targetMachine() const
Definition: BFOptimization.cc:81
BFOptimization::sched_
BF2Scheduler & sched_
Definition: BFOptimization.hh:103
BFEarlyBypass::src_
MoveNode & src_
Definition: BFEarlyBypass.hh:46
assert
#define assert(condition)
Definition: Application.hh:86
BF2ScheduleFront::bypassed
void bypassed(MoveNode &src, MoveNode &dst)
Definition: BF2ScheduleFront.hh:63
Reversible::undo
virtual void undo()
Definition: Reversible.cc:69
BFOptimization::ddg
DataDependenceGraph & ddg()
Definition: BFOptimization.cc:70
BFDREEarly
Definition: BFDREEarly.hh:40
BFOptimization::BFOptimization
BFOptimization(BF2Scheduler &sched)
Definition: BFOptimization.hh:75
BF2Scheduler::currentFront
BF2ScheduleFront * currentFront()
Definition: BF2Scheduler.hh:188
Reversible::runPreChild
bool runPreChild(Reversible *preChild)
Definition: Reversible.cc:127
MoveNode::isScheduled
bool isScheduled() const
Definition: MoveNode.cc:409
Reversible::runPostChild
bool runPostChild(Reversible *preChild)
Definition: Reversible.cc:139
BFOptimization::mightBeReady
virtual void mightBeReady(MoveNode &mn)
Definition: BFOptimization.cc:953
BFMergeAndKeepUser
Definition: BFMergeAndKeepUser.hh:41