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

#include <BFPostpassBypasser.hh>

Inheritance diagram for BFPostpassBypasser:
Inheritance graph
Collaboration diagram for BFPostpassBypasser:
Collaboration graph

Public Member Functions

 BFPostpassBypasser (BF2Scheduler &sched)
 
bool operator() () 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 Member Functions

bool tryBypassNode (MoveNode &n)
 

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)
 
virtual void undoOnlyMe ()
 
- 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 42 of file BFPostpassBypasser.hh.

Constructor & Destructor Documentation

◆ BFPostpassBypasser()

BFPostpassBypasser::BFPostpassBypasser ( BF2Scheduler sched)
inline

Definition at line 44 of file BFPostpassBypasser.hh.

44  :
45  BFOptimization(sched) {}

Member Function Documentation

◆ operator()()

bool BFPostpassBypasser::operator() ( )
overridevirtual

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

Implements Reversible.

Definition at line 42 of file BFPostpassBypasser.cc.

42  {
43 
44  for (int i = 0; i < ddg().nodeCount(); i++) {
45  MoveNode& n = ddg().node(i);
46  bool dred = tryBypassNode(n);
47  // make sure do not skip over one if dre removes something
48  if (dred) {
49  i--;
50  }
51  }
52  return !postChildren_.empty();
53 }

References BFOptimization::ddg(), BoostGraph< GraphNode, GraphEdge >::node(), BoostGraph< GraphNode, GraphEdge >::nodeCount(), Reversible::postChildren_, and tryBypassNode().

Here is the call graph for this function:

◆ tryBypassNode()

bool BFPostpassBypasser::tryBypassNode ( MoveNode n)
private

Definition at line 55 of file BFPostpassBypasser.cc.

55  {
56 
57  DataDependenceEdge* bypassEdge = sched_.findBypassEdge(n);
58  if (bypassEdge == NULL) {
59  return false;
60  }
61  MoveNode& src = ddg().tailNode(*bypassEdge);
62 
63  if (!ddg().guardsAllowBypass(src, n)) {
64  return false;
65  }
66 
67  auto bypass = new BFPostpassBypass(sched_, src, n, bypassEdge->isBackEdge());
68  if (!(runPostChild(bypass))) {
69  return false;
70  }
71  return bypass->dred();
72 }

References BFOptimization::ddg(), BF2Scheduler::findBypassEdge(), DataDependenceEdge::isBackEdge(), Reversible::runPostChild(), BFOptimization::sched_, and BoostGraph< GraphNode, GraphEdge >::tailNode().

Referenced by operator()().

Here is the call graph for this function:

The documentation for this class was generated from the following files:
Reversible::postChildren_
std::stack< Reversible * > postChildren_
Definition: Reversible.hh:58
BoostGraph::tailNode
virtual Node & tailNode(const Edge &edge) const
BoostGraph::node
Node & node(const int index) const
DataDependenceEdge::isBackEdge
bool isBackEdge() const
Definition: DataDependenceEdge.hh:118
MoveNode
Definition: MoveNode.hh:65
BFOptimization::sched_
BF2Scheduler & sched_
Definition: BFOptimization.hh:103
BF2Scheduler::findBypassEdge
DataDependenceEdge * findBypassEdge(const MoveNode &mn)
Definition: BF2Scheduler.cc:838
BFOptimization::ddg
DataDependenceGraph & ddg()
Definition: BFOptimization.cc:70
BFOptimization::BFOptimization
BFOptimization(BF2Scheduler &sched)
Definition: BFOptimization.hh:75
DataDependenceEdge
Definition: DataDependenceEdge.hh:43
Reversible::runPostChild
bool runPostChild(Reversible *preChild)
Definition: Reversible.cc:139
BFPostpassBypass
Definition: BFPostpassBypass.hh:42
BoostGraph::nodeCount
int nodeCount() const
BFPostpassBypasser::tryBypassNode
bool tryBypassNode(MoveNode &n)
Definition: BFPostpassBypasser.cc:55