OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
BFCopyRegWithOp Class Reference

#include <BFCopyRegWithOp.hh>

Inheritance diagram for BFCopyRegWithOp:
Inheritance graph
Collaboration diagram for BFCopyRegWithOp:
Collaboration graph

Public Member Functions

 BFCopyRegWithOp (BF2Scheduler &sched, MoveNode &mn, int lc, MachineConnectivityCheck::FUSet candidateFUs)
 
virtual ~BFCopyRegWithOp ()
 
- Public Member Functions inherited from BFRegCopy
 BFRegCopy (BF2Scheduler &sched, MoveNode &mn, int lc)
 
bool operator() ()
 
MoveNodegetRegCopy ()
 
void undoOnlyMe ()
 
void undoDDG ()
 
void createAntidepsForReg (MoveNode &firstMove, MoveNode &lastMove, const TTAMachine::RegisterFile &rf, int index, TCEString regName, BasicBlockNode &bbn, bool loopScheduling)
 
- 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

bool splitMove (BasicBlockNode &bbn)
 
void undoSplit ()
 
- Protected Member Functions inherited from BFRegCopy
MoveNodecreateRegCopy (bool after)
 
- 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

ProgramOperationPtr pop_
 
MachineConnectivityCheck::FUSet candidateFUs_
 
- Protected Attributes inherited from BFRegCopy
MoveNodemn_
 
MoveNoderegCopy_
 
int lc_
 
- Protected Attributes inherited from BFOptimization
BF2Schedulersched_
 
- 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 MoveNodegetSisterTrigger (const MoveNode &mn, const TTAMachine::Machine &mach)
 
- Static Protected Attributes inherited from BFOptimization
static std::map< MoveNode *, MoveNode *, MoveNode::ComparatorprologMoves_
 

Detailed Description

Definition at line 8 of file BFCopyRegWithOp.hh.

Constructor & Destructor Documentation

◆ BFCopyRegWithOp()

BFCopyRegWithOp::BFCopyRegWithOp ( BF2Scheduler sched,
MoveNode mn,
int  lc,
MachineConnectivityCheck::FUSet  candidateFUs 
)
inline

Definition at line 10 of file BFCopyRegWithOp.hh.

11 :
12 BFRegCopy(sched,mn,lc), candidateFUs_(candidateFUs) {}
MachineConnectivityCheck::FUSet candidateFUs_

◆ ~BFCopyRegWithOp()

virtual BFCopyRegWithOp::~BFCopyRegWithOp ( )
inlinevirtual

Definition at line 13 of file BFCopyRegWithOp.hh.

13{}

Member Function Documentation

◆ splitMove()

bool BFCopyRegWithOp::splitMove ( BasicBlockNode bbn)
protectedvirtual

Implements BFRegCopy.

Definition at line 15 of file BFCopyRegWithOp.cc.

15 {
17 OperationPool opPool;
18 auto& op = opPool.operation("COPY");
19 pop_ = std::make_shared<ProgramOperation>(op);
20
21 mn_.move().setSource(cGen.createTerminalFUPort("COPY",2));
22 regCopy_->move().setDestination(cGen.createTerminalFUPort("COPY",1));
23 pop_->addInputNode(*regCopy_);
24 pop_->addOutputNode(mn_);
27
28 for (auto fu : candidateFUs_) {
31 fu->name());
32 mn_.move().addAnnotation(srcCandidate);
33
36 fu->name());
37 regCopy_->move().addAnnotation(dstCandidate);
38 }
39
40 // move RAW in edges...
41 for (int i = ddg().rootGraph()->inDegree(mn_)-1; i >= 0; i--) {
42 auto& e = ddg().rootGraph()->inEdge(mn_,i);
43 if (e.isRAW() && !e.headPseudo()) {
45 }
46 }
47
48 // move antidep edges.
49 for (int i = ddg().rootGraph()->outDegree(mn_)-1; i >= 0; i--) {
50 auto& e = ddg().rootGraph()->outEdge(mn_,i);
51 if (e.isRegisterOrRA() && !e.isRAW() && !e.tailPseudo()) {
53 }
54 }
55
56
61 TCEString("COPY"))));
62 return true;
63}
ProgramOperationPtr pop_
DataDependenceGraph & ddg()
const TTAMachine::Machine & targetMachine() const
MoveNode * regCopy_
Definition BFRegCopy.hh:70
MoveNode & mn_
Definition BFRegCopy.hh:69
BoostGraph * rootGraph()
virtual Edge & outEdge(const Node &node, const int index) const
virtual Edge & inEdge(const Node &node, const int index) const
virtual void moveOutEdge(const Node &source, const Node &destination, Edge &edge, const Node *head=NULL, bool childs=false)
virtual void moveInEdge(const Node &source, const Node &destination, Edge &edge, const Node *tail=NULL, bool childs=false)
virtual void connectNodes(const Node &nTail, const Node &nHead, Edge &e)
void setSourceOperationPtr(ProgramOperationPtr po)
Definition MoveNode.cc:541
TTAProgram::Move & move()
void addDestinationOperationPtr(ProgramOperationPtr po)
Definition MoveNode.cc:533
Operation & operation(const char *name)
void addAnnotation(const ProgramAnnotation &annotation)
void setSource(Terminal *src)
Definition Move.cc:312
void setDestination(Terminal *dst)
Definition Move.cc:333
@ ANN_CONN_CANDIDATE_UNIT_DST
Dst. unit candidate.
@ ANN_CONN_CANDIDATE_UNIT_SRC
Src. unit candidate.

References TTAProgram::AnnotatedInstructionElement::addAnnotation(), MoveNode::addDestinationOperationPtr(), TTAProgram::ProgramAnnotation::ANN_CONN_CANDIDATE_UNIT_DST, TTAProgram::ProgramAnnotation::ANN_CONN_CANDIDATE_UNIT_SRC, candidateFUs_, BoostGraph< GraphNode, GraphEdge >::connectNodes(), TTAProgram::CodeGenerator::createTerminalFUPort(), BFOptimization::ddg(), DataDependenceEdge::DEP_UNKNOWN, DataDependenceEdge::EDGE_OPERATION, BoostGraph< GraphNode, GraphEdge >::inEdge(), BFRegCopy::mn_, MoveNode::move(), BoostGraph< GraphNode, GraphEdge >::moveInEdge(), BoostGraph< GraphNode, GraphEdge >::moveOutEdge(), OperationPool::operation(), BoostGraph< GraphNode, GraphEdge >::outEdge(), pop_, BFRegCopy::regCopy_, BoostGraph< GraphNode, GraphEdge >::rootGraph(), TTAProgram::Move::setDestination(), TTAProgram::Move::setSource(), MoveNode::setSourceOperationPtr(), and BFOptimization::targetMachine().

Here is the call graph for this function:

◆ undoSplit()

void BFCopyRegWithOp::undoSplit ( )
protectedvirtual

Implements BFRegCopy.

Definition at line 65 of file BFCopyRegWithOp.cc.

65 {
66
69
70 // restore antidep edges.
71 for (int i = ddg().rootGraph()->outDegree(*regCopy_)-1; i >= 0; i--) {
72 auto& e = ddg().rootGraph()->outEdge(*regCopy_,i);
73 if (e.isRegisterOrRA() && !e.isRAW() && !e.tailPseudo()) {
75 }
76 }
77
78 // restore raw edges
79 for (int i = ddg().rootGraph()->inDegree(*regCopy_)-1; i >= 0; i--) {
80 auto& e = ddg().rootGraph()->inEdge(*regCopy_,i);
81 if (e.isRAW() && !e.headPseudo()) {
83 }
84 }
85
86
87 pop_->removeOutputNode(mn_);
88 pop_->removeInputNode(*regCopy_);
92 pop_ = ProgramOperationPtr(); // this should delete the obj.
93
95}
std::shared_ptr< ProgramOperation > ProgramOperationPtr
Definition MoveNode.hh:53
virtual void disconnectNodes(const Node &nTail, const Node &nHead)
void unsetSourceOperation()
Definition MoveNode.cc:760
void removeDestinationOperation(const ProgramOperation *po)
Definition MoveNode.cc:741
void removeAnnotations(ProgramAnnotation::Id id=ProgramAnnotation::ANN_UNDEF_ID)
Terminal & source() const
Definition Move.cc:302
virtual Terminal * copy() const =0

References TTAProgram::ProgramAnnotation::ANN_CONN_CANDIDATE_UNIT_SRC, TTAProgram::Terminal::copy(), BFOptimization::ddg(), BoostGraph< GraphNode, GraphEdge >::disconnectNodes(), BoostGraph< GraphNode, GraphEdge >::inEdge(), BFRegCopy::mn_, MoveNode::move(), BoostGraph< GraphNode, GraphEdge >::moveInEdge(), BoostGraph< GraphNode, GraphEdge >::moveOutEdge(), BoostGraph< GraphNode, GraphEdge >::outEdge(), pop_, BFRegCopy::regCopy_, TTAProgram::AnnotatedInstructionElement::removeAnnotations(), MoveNode::removeDestinationOperation(), BoostGraph< GraphNode, GraphEdge >::rootGraph(), TTAProgram::Move::setSource(), TTAProgram::Move::source(), and MoveNode::unsetSourceOperation().

Here is the call graph for this function:

Member Data Documentation

◆ candidateFUs_

MachineConnectivityCheck::FUSet BFCopyRegWithOp::candidateFUs_
protected

Definition at line 18 of file BFCopyRegWithOp.hh.

Referenced by splitMove().

◆ pop_

ProgramOperationPtr BFCopyRegWithOp::pop_
protected

Definition at line 17 of file BFCopyRegWithOp.hh.

Referenced by splitMove(), and undoSplit().


The documentation for this class was generated from the following files: