Go to the documentation of this file.
33 #ifndef COPYING_DELAY_SLOT_FILLER_HH
34 #define COPYING_DELAY_SLOT_FILLER_HH
60 class InstructionReferenceManager;
64 class TerminalInstructionAddress;
67 class TerminalImmediate;
88 static std::pair<int, TTAProgram::Move*>
findJump(
92 static std::pair<TTAProgram::Move*, std::shared_ptr<TTAProgram::Immediate> >
97 typedef std::map<TCEString,TTAProgram::TerminalImmediate*>
118 unsigned int registerIndex);
131 std::shared_ptr<TTAProgram::Immediate> jumpAddressImmediate,
192 std::map<ProgramOperation*, ProgramOperationPtr, ProgramOperation::Comparator>
194 std::map<ProgramOperation*, ProgramOperationPtr, ProgramOperation::Comparator>
196 std::map<MoveNode*,MoveNode*,MoveNode::Comparator>
moveNodes_;
198 std::map<TTAProgram::Move*, std::shared_ptr<TTAProgram::Move> >
moves_;
199 std::map<MoveNode*, const TTAMachine::Bus*, MoveNode::Comparator>
moveNodeBuses_;
206 std::map<MoveNode*,bool,MoveNode::Comparator>
mnOwned_;
void addResourceManager(TTAProgram::BasicBlock &bbn, SimpleResourceManager &rm)
std::map< MoveNode *, const TTAMachine::Bus *, MoveNode::Comparator > moveNodeBuses_
std::map< ProgramOperation *, ProgramOperationPtr, ProgramOperation::Comparator > oldProgramOperations_
ControlFlowGraph::NodeSet killedBBs_
bool allowedToSpeculate(MoveNode &mn) const
bool writesRegister(TTAProgram::Move &move, const TTAMachine::RegisterFile *rf, unsigned int registerIndex)
TTAMachine::Machine * machine
the architecture definition of the estimated processor
void bbnScheduled(BasicBlockNode &bbn)
std::set< MoveNode *, typename MoveNode ::Comparator > NodeSet
std::map< TTAProgram::BasicBlock *, SimpleResourceManager * > resourceManagers_
static std::pair< int, TTAProgram::Move * > findJump(TTAProgram::BasicBlock &bb, ControlFlowEdge::CFGEdgePredicate *pred=nullptr)
bool updateJumpsAndCfg(BasicBlockNode &jumpBBN, BasicBlockNode &fillingBBN, ControlFlowEdge &fillEdge, TTAProgram::Move *jumpAddressMove, std::shared_ptr< TTAProgram::Immediate > jumpAddressImmediate, TTAProgram::Move *jumpMove, int slotsFilled, TTAProgram::Move *skippedJump)
ProgramOperationPtr getProgramOperationPtr(ProgramOperationPtr old, BasicBlockNode &bbn, bool fillOverBackEdge)
std::shared_ptr< TTAProgram::Move > getMove(TTAProgram::Move &old)
std::map< TTAProgram::Move *, std::shared_ptr< TTAProgram::Move > > moves_
void initialize(ControlFlowGraph &cfg, DataDependenceGraph &ddg, const TTAMachine::Machine &machine)
bool checkIncomingDeps(MoveNode &mnOld, BasicBlockNode &blockToFillNode, int cycleDiff)
bool tryToAssignNodes(MoveNodeListVector &moves, int slotsToFill, int firstCycleToFill, ResourceManager &rm, int nextBBStart, DataDependenceGraph::NodeSet &tempAssigns)
std::shared_ptr< ProgramOperation > ProgramOperationPtr
bool checkImmediatesAfter(TTAProgram::BasicBlock &nextBB, int slotsToFill)
void bbFilled(BasicBlockNode &bbn)
void fillDelaySlots(ControlFlowGraph &cfg, DataDependenceGraph &ddg, const TTAMachine::Machine &machine)
std::map< MoveNode *, MoveNode *, MoveNode::Comparator > oldMoveNodes_
std::map< MoveNode *, MoveNode *, MoveNode::Comparator > moveNodes_
std::map< BasicBlockNode *, DataDependenceGraph::NodeSet > tempResultNodes_
void unassignTempAssigns(DataDependenceGraph::NodeSet &tempAssigns, SimpleResourceManager &rm)
std::map< ProgramOperation *, ProgramOperationPtr, ProgramOperation::Comparator > programOperations_
bool tryToFillSlots(BasicBlockNode &blockToFillNode, BasicBlockNode &nextBBNode, bool fallThru, TTAProgram::Move *jumpMove, int slotsToFill, int removeGuards, int grIndex, const TTAMachine::RegisterFile *grFile, TTAProgram::Move *&skippedJump, int delaySlots)
bool collectMoves(BasicBlockNode &blockToFillNode, BasicBlockNode &nextBBN, MoveNodeListVector &moves, int slotsToFill, bool fallThru, int removeGuards, TTAProgram::Move *jumpMove, int grIndex, const TTAMachine::RegisterFile *grFile, TTAProgram::Move *&skippedJump, int delaySlots)
static std::pair< TTAProgram::Move *, std::shared_ptr< TTAProgram::Immediate > > findJumpImmediate(int jumpIndex, TTAProgram::Move &jumpMove, TTAProgram::InstructionReferenceManager &irm)
std::vector< std::list< MoveNode * > > MoveNodeListVector
bool mightFillIncomingTo(BasicBlockNode &bbn)
std::map< BasicBlockNode *, BBNStates > bbnStatus_
bool tryToAssignOtherMovesOfOp(ProgramOperation &po, int firstCycleToFill, ResourceManager &rm, int lastCycle, int nextBBStart, DataDependenceGraph::NodeSet &tempAssigns)
std::map< TCEString, TTAProgram::TerminalImmediate * > PendingImmediateMap
MoveNode & getMoveNode(MoveNode &old, BasicBlockNode &bbn, bool fillOverBackEdge)
bool poMoved(ProgramOperationPtr po, MoveNodeListVector &movesToCopy, DataDependenceGraph::NodeSet &tempAssigns)
void loseCopies(DataDependenceGraph::NodeSet *keptTempNodes)
bool tryToAssignOtherMovesOfDestOps(MoveNode &mn, int firstCycleToFill, ResourceManager &rm, int lastCycle, int nextBBStart, DataDependenceGraph::NodeSet &tempAssigns)
bool areAllJumpPredsFilled(BasicBlockNode &bbn) const
bool areAllJumpPredsScheduled(BasicBlockNode &bbn) const
bool updateFTBBAndCfg(BasicBlockNode &jumpingBB, BasicBlockNode &nextBBN, ControlFlowEdge &edge, int slotsFilled)
~CopyingDelaySlotFiller()
void finishBB(BasicBlockNode &bbn, bool force=false)
DataDependenceGraph * ddg_
std::map< BasicBlockNode *, std::set< ProgramOperationPtr, ProgramOperation::Comparator > > tempPOs_
std::map< MoveNode *, bool, MoveNode::Comparator > mnOwned_