OpenASIP
2.0
|
#include <BUBasicBlockScheduler.hh>
Classes | |
struct | ltstr |
Protected Types | |
typedef std::set< MoveNode *, ltstr > | OrderedSet |
Protected Attributes | |
MoveNode * | jumpMove_ |
std::map< MoveNode *, std::vector< MoveNode * >, MoveNode::Comparator > | bypassDestinations_ |
std::map< MoveNode *, std::vector< int >, MoveNode::Comparator > | bypassDestinationsCycle_ |
std::map< MoveNode *, std::vector< const TTAMachine::Bus * >, MoveNode::Comparator > | bypassDestinationsBus_ |
std::set< MoveNode * > | droppedNodes_ |
unsigned int | endCycle_ |
bool | bypass_ |
bool | dre_ |
int | bypassDistance_ |
Protected Attributes inherited from BasicBlockScheduler | |
const TTAMachine::Machine * | targetMachine_ |
The target machine we are scheduling the program against. More... | |
DataDependenceGraph * | ddg_ |
DDG of the currently scheduled BB. More... | |
SimpleResourceManager * | rm_ |
Resource Manager of the currently scheduled BB. More... | |
std::map< const MoveNode *, DataDependenceGraph::NodeSet > | scheduledTempMoves_ |
Stores the MoveNodes that were scheduled as temp moves during scheduling of the operand move. More... | |
SoftwareBypasser * | softwareBypasser_ |
The software bypasser to use to bypass registers when possible. More... | |
RegisterRenamer * | renamer_ |
int | minCycle_ |
The earliest cycle to schedule moves in. Used to leave room for sched_yield() by the sched_yield() emitter. More... | |
MoveNodeSelector * | selector_ |
boost::timer | schedulingTime_ |
Time for getting the scheduling time for current basic block. More... | |
int | bypassedCount_ |
int | deadResults_ |
LLVMTCECmdLineOptions * | options_ |
MoveNode * | jumpNode_ |
int | tripCount_ |
Additional Inherited Members | |
Static Public Member Functions inherited from BasicBlockScheduler | |
static MoveNode * | findTrigger (const ProgramOperation &po, const TTAMachine::Machine &mach) |
Static Public Member Functions inherited from BasicBlockPass | |
static void | copyRMToBB (SimpleResourceManager &rm, TTAProgram::BasicBlock &bb, const TTAMachine::Machine &targetMachine, TTAProgram::InstructionReferenceManager &irm, int lastCycle=-1) |
Static Protected Member Functions inherited from BasicBlockScheduler | |
static MoveNode * | findTriggerFromUnit (const ProgramOperation &po, const TTAMachine::Unit &unit) |
A class that implements the functionality of a bottom up basic block scheduler.
Schedules the program one basic block at a time. Does not fill delay slots if they couldn't be filled with the basic block's contents itself (no instruction importing).
Definition at line 61 of file BUBasicBlockScheduler.hh.
|
protected |
Definition at line 97 of file BUBasicBlockScheduler.hh.
BUBasicBlockScheduler::BUBasicBlockScheduler | ( | InterPassData & | data, |
SoftwareBypasser * | bypasser = NULL , |
||
RegisterRenamer * | renamer = NULL |
||
) |
Constructs the basic block scheduler.
data | Interpass data |
bypasser | Helper module implementing software bypassing |
delaySlotFiller | Helper module implementing jump delay slot filling |
registerRenamer | Helper module implementing register renaming |
Definition at line 86 of file BUBasicBlockScheduler.cc.
References Application::cmdLineOptions(), jumpMove_, and BasicBlockScheduler::options_.
|
virtual |
|
protected |
Tries to bypass node with all of it's successors.
moveNode,node | which is tried to bypass |
maxResultCycle,cycle | of latest of rescheduled nodes |
Definition at line 1602 of file BUBasicBlockScheduler.cc.
References assert, bypass_, bypassDestinations_, bypassDestinationsBus_, bypassDestinationsCycle_, bypassDistance_, DataDependenceGraph::copyDepsOver(), MoveNode::cycle(), BasicBlockScheduler::ddg_, findBypassDestinations(), DataDependenceGraph::firstScheduledRegisterRead(), DataDependenceGraph::guardsAllowBypass(), MoveNode::isDestinationVariable(), MoveNode::isScheduled(), MoveNode::isSourceVariable(), DataDependenceGraph::lastScheduledRegisterRead(), DataDependenceGraph::mergeAndKeepUser(), DataDependenceGraph::onlyRegisterRawDestinations(), DataDependenceGraph::resultUsed(), BasicBlockScheduler::rm_, scheduleMove(), BasicBlockScheduler::succeedingTempMove(), MoveNode::toString(), undoBypass(), BasicBlockScheduler::unschedule(), and GraphBase< GraphNode, GraphEdge >::writeToDotFile().
Referenced by handleDDG(), handleLoopDDG(), scheduleResultReads(), scheduleResultReadTempMoves(), and scheduleRRTempMoves().
|
protected |
Finaly, remove moves that were dropped during dead result move elimination also from the parent of the given subgraph DDG.
Definition at line 1874 of file BUBasicBlockScheduler.cc.
References bypassDestinations_, bypassDestinationsBus_, bypassDestinationsCycle_, MapTools::containsKey(), BasicBlockScheduler::ddg_, droppedNodes_, MoveNode::isScheduled(), BoostGraph< GraphNode, GraphEdge >::removeNode(), and BoostGraph< GraphNode, GraphEdge >::rootGraph().
Referenced by handleDDG(), and handleLoopDDG().
|
inline |
Definition at line 86 of file BasicBlockPass.hh.
|
protected |
Definition at line 1744 of file BUBasicBlockScheduler.cc.
References __func__, assert, bypassDestinations_, MapTools::containsKey(), BasicBlockScheduler::ddg_, TTAProgram::Move::destination(), dre_, BoostGraph< GraphNode, GraphEdge >::dropNode(), droppedNodes_, TTAProgram::Terminal::equals(), MoveNode::isDestinationVariable(), MoveNode::isScheduled(), MoveNode::isSourceVariable(), BUMoveNodeSelector::mightBeReady(), MoveNode::move(), BUMoveNodeSelector::notifyScheduled(), BoostGraph< GraphNode, GraphEdge >::predecessors(), DataDependenceGraph::resultUsed(), BoostGraph< GraphNode, GraphEdge >::rootGraph(), BasicBlockScheduler::scheduledTempMoves_, TTAProgram::Move::source(), MoveNode::toString(), and GraphBase< GraphNode, GraphEdge >::writeToDotFile().
Referenced by handleDDG(), handleLoopDDG(), scheduleOperation(), scheduleResultReadTempMoves(), and scheduleRRTempMoves().
|
protected |
Finds a destination where to bypass.
Goes through ddg and checks for connectivity.
Definition at line 1488 of file BUBasicBlockScheduler.cc.
References MachineConnectivityCheck::canSourceWriteToAnyDestinationPort(), BasicBlockScheduler::ddg_, TTAProgram::Move::destination(), SimpleResourceManager::initiationInterval(), MoveNode::isScheduled(), MoveNode::move(), DataDependenceGraph::onlyRegisterRawDestinations(), DataDependenceGraph::onlyRegisterRawSource(), TTAProgram::Terminal::port(), BasicBlockScheduler::rm_, and GraphBase< GraphNode, GraphEdge >::writeToDotFile().
Referenced by bypassNode().
|
virtual |
Schedules a piece of code in a DDG
ddg | The ddg containing the code |
rm | Resource manager that is to be used. |
targetMachine | The target machine. |
Exception | several TCE exceptions can be thrown in case of a scheduling error. |
Reimplemented from BasicBlockScheduler.
Definition at line 113 of file BUBasicBlockScheduler.cc.
References __func__, abortWithError, bypass_, SchedulerCmdLineOptions::bypassDistance(), bypassDistance_, bypassNode(), BUMoveNodeSelector::candidates(), clearRemovedNodes(), BasicBlockScheduler::ddg_, BasicBlockScheduler::ddgSnapshot(), debugLog, TTAProgram::Move::destination(), dre_, DataDependenceGraph::DUMP_DOT, DataDependenceGraph::DUMP_XML, LLVMTCECmdLineOptions::dumpDDGsDot(), LLVMTCECmdLineOptions::dumpDDGsXML(), endCycle_, finalizeSchedule(), RegisterRenamer::initialize(), MoveNode::isMove(), MoveNode::isOperationMove(), TTAProgram::Terminal::isRA(), MoveNodeGroup::isScheduled(), MoveNode::isScheduled(), SchedulerCmdLineOptions::killDeadResults(), SimpleResourceManager::largestCycle(), MoveNode::move(), MoveNodeGroup::node(), BoostGraph< GraphNode, GraphEdge >::node(), MoveNodeGroup::nodeCount(), BoostGraph< GraphNode, GraphEdge >::nodeCount(), BasicBlockScheduler::options_, BasicBlockScheduler::renamer_, DataDependenceGraph::resultUsed(), BasicBlockScheduler::rm_, DataDependenceGraph::scheduledNodeCount(), scheduleMove(), scheduleOperation(), scheduleRRMove(), BasicBlockScheduler::selector_, SimpleResourceManager::setMaxCycle(), RegisterRenamer::setSelector(), SimpleResourceManager::smallestCycle(), BasicBlockScheduler::targetMachine_, MoveNode::toString(), undoBypass(), unscheduleAllNodes(), and GraphBase< GraphNode, GraphEdge >::writeToDotFile().
|
virtual |
Schedules loop in a DDG
ddg | The ddg containing the loop |
rm | Resource manager that is to be used. |
targetMachine | The target machine. |
Exception | several TCE exceptions can be thrown in case of a scheduling error. |
Reimplemented from BasicBlockScheduler.
Definition at line 260 of file BUBasicBlockScheduler.cc.
References abortWithError, bypass_, SchedulerCmdLineOptions::bypassDistance(), bypassDistance_, bypassNode(), BUMoveNodeSelector::candidates(), clearRemovedNodes(), BasicBlockScheduler::ddg_, BasicBlockScheduler::ddgSnapshot(), debugLog, TTAProgram::Move::destination(), dre_, DataDependenceGraph::DUMP_DOT, DataDependenceGraph::DUMP_XML, LLVMTCECmdLineOptions::dumpDDGsDot(), LLVMTCECmdLineOptions::dumpDDGsXML(), endCycle_, finalizeSchedule(), DataDependenceGraph::findLoopLimitAndIndex(), RegisterRenamer::initialize(), SimpleResourceManager::initiationInterval(), MoveNode::isMove(), MoveNode::isOperationMove(), TTAProgram::Terminal::isRA(), MoveNodeGroup::isScheduled(), jumpMove_, SchedulerCmdLineOptions::killDeadResults(), DataDependenceGraph::largestCycle(), Application::logStream(), BasicBlockScheduler::minCycle_, MoveNode::move(), MoveNodeGroup::node(), BoostGraph< GraphNode, GraphEdge >::node(), MoveNodeGroup::nodeCount(), BoostGraph< GraphNode, GraphEdge >::nodeCount(), BasicBlockScheduler::notifyScheduled(), BasicBlockScheduler::options_, BasicBlockScheduler::renamer_, DataDependenceGraph::resultUsed(), BasicBlockScheduler::rm_, DataDependenceGraph::scheduledNodeCount(), BasicBlockScheduler::scheduledTempMoves_, scheduleMove(), scheduleOperation(), scheduleRRMove(), BasicBlockScheduler::schedulingTime_, RegisterRenamer::setSelector(), TTAProgram::Move::setSource(), SimpleResourceManager::smallestCycle(), DataDependenceGraph::smallestCycle(), TTAProgram::Move::source(), BasicBlockScheduler::targetMachine_, Conversion::toString(), BasicBlockScheduler::tripCount_, unscheduleAllNodes(), SimValue::unsignedValue(), TTAProgram::TerminalImmediate::value(), SimValue::width(), and GraphBase< GraphNode, GraphEdge >::writeToDotFile().
|
virtual |
Optional longer description of the pass.
This description can include usage instructions, details of choice of algorithmic details, etc.
Reimplemented from BasicBlockScheduler.
Definition at line 1210 of file BUBasicBlockScheduler.cc.
Finds the temp move preceding the given movenode.
If it does not have one, returns null.
current | MoveNode whose tempmoves we are searching |
Definition at line 1425 of file BUBasicBlockScheduler.cc.
References TTAProgram::ProgramAnnotation::ANN_CONNECTIVITY_MOVE, assert, BasicBlockScheduler::ddg_, TTAProgram::AnnotatedInstructionElement::hasAnnotations(), MoveNode::isScheduled(), MoveNode::move(), and BoostGraph< GraphNode, GraphEdge >::predecessors().
Referenced by scheduleOperand().
|
protected |
Schedules the (possible) temporary register copy moves (due to missing connectivity) preceeding the given input move.
The function recursively goes through all the temporary moves added to the given input move.
operandMove | A temp move whose predecessor has to be scheduled. |
operandWrite | The original move of which temp moves to schedule. |
Definition at line 1290 of file BUBasicBlockScheduler.cc.
References TTAProgram::ProgramAnnotation::ANN_CONNECTIVITY_MOVE, assert, MoveNode::cycle(), BasicBlockScheduler::ddg_, DataDependenceEdge::DEP_RAW, TTAProgram::Move::destination(), DataDependenceEdge::EDGE_REGISTER, endCycle_, DataDependenceGraph::firstScheduledRegisterRead(), TTAProgram::AnnotatedInstructionElement::hasAnnotations(), TTAProgram::Terminal::index(), BoostGraph< GraphNode, GraphEdge >::inEdges(), MoveNode::isScheduled(), Application::logStream(), MoveNode::move(), TTAProgram::Terminal::registerFile(), BasicBlockScheduler::scheduledTempMoves_, scheduleMove(), BoostGraph< GraphNode, GraphEdge >::tailNode(), MoveNode::toString(), and GraphBase< GraphNode, GraphEdge >::writeToDotFile().
Referenced by scheduleOperand().
|
protected |
Schedules a single move to the earliest possible cycle, taking in account the DDG, resource constraints, and latencies in producing source values.
This method assumes the move is possible to schedule with regards to connectivity and resources. Short immediates are converted to long immediates when needed.
move | The move to schedule. |
earliestCycle | The earliest cycle to try. |
Definition at line 960 of file BUBasicBlockScheduler.cc.
References __func__, Operation::affectsCount(), TTAProgram::ProgramAnnotation::ANN_REQUIRES_LIMM, TTAProgram::ProgramAnnotation::ANN_STACKFRAME_PROCEDURE_RETURN, assert, SimpleResourceManager::assign(), SimpleResourceManager::canTransportImmediate(), TTAMachine::Machine::controlUnit(), MoveNode::cycle(), BasicBlockScheduler::ddg_, TTAMachine::ControlUnit::delaySlots(), TTAProgram::Move::destination(), MoveNode::destinationOperation(), SimpleResourceManager::earliestCycle(), DataDependenceGraph::earliestCycle(), endCycle_, DataDependenceGraph::findLimitingAntidependenceDestination(), TTAProgram::Terminal::functionUnit(), MoveNode::guardLatency(), TTAProgram::AnnotatedInstructionElement::hasAnnotations(), Operation::hasSideEffects(), SimpleResourceManager::initiationInterval(), ProgramOperation::isAnyOutputAssigned(), TTAProgram::Move::isControlFlowMove(), MoveNode::isDestinationOperation(), TTAProgram::Terminal::isGPR(), TTAProgram::Move::isReturn(), MoveNode::isScheduled(), MoveNode::isSourceConstant(), MoveNode::isSourceOperation(), TTAProgram::Move::isUnconditional(), jumpMove_, TTAMachine::HWOperation::latency(), SimpleResourceManager::latestCycle(), DataDependenceGraph::latestCycle(), MoveNode::latestTriggerWriteCycle(), MoveNode::move(), Operation::name(), TTAMachine::FunctionUnit::operation(), ProgramOperation::operation(), ProgramOperation::outputMove(), ProgramOperation::outputMoveCount(), DataDependenceGraph::removeIncomingGuardEdges(), RegisterRenamer::renameDestinationRegister(), BasicBlockScheduler::renamer_, RegisterRenamer::renameSourceRegister(), BasicBlockScheduler::rm_, TTAProgram::AnnotatedInstructionElement::setAnnotation(), TTAProgram::Move::setGuard(), MoveNode::sourceOperation(), BasicBlockScheduler::targetMachine_, MoveNode::toString(), tryToOptimizeWaw(), SimpleResourceManager::unassign(), Operation::writesMemory(), and GraphBase< GraphNode, GraphEdge >::writeToDotFile().
Referenced by bypassNode(), handleDDG(), handleLoopDDG(), scheduleInputOperandTempMoves(), scheduleOperand(), scheduleResultReads(), scheduleResultReadTempMoves(), scheduleRRMove(), scheduleRRTempMoves(), tryToOptimizeWaw(), and undoBypass().
|
protected |
Checks existence of temporary moves and schedules operand according to discovered dependencies.
Definition at line 1449 of file BUBasicBlockScheduler.cc.
References assert, MoveNode::cycle(), BasicBlockScheduler::ddg_, DataDependenceGraph::firstScheduledRegisterWrite(), TTAProgram::Terminal::index(), MoveNode::isScheduled(), MoveNode::move(), precedingTempMove(), TTAProgram::Terminal::registerFile(), scheduleInputOperandTempMoves(), scheduleMove(), and TTAProgram::Move::source().
Referenced by scheduleOperandWrites().
|
protected |
Schedules operand moves of an operation execution.
Assumes the given MoveNodeGroup contains all moves in the operation execution. Also assumes that all result moves of the MoveNodeGroup have been scheduled. Assumes bottom up scheduling.
moves | Moves of the operation execution. |
cycle | latest cycle for starting scheduling of operands |
Definition at line 664 of file BUBasicBlockScheduler.cc.
References assert, MoveNode::cycle(), BasicBlockScheduler::ddg_, TTAProgram::Move::destination(), MoveNode::destinationOperation(), BasicBlockScheduler::findTrigger(), BoostGraph< GraphNode, GraphEdge >::hasNode(), SimpleResourceManager::initiationInterval(), MoveNode::isDestinationOperation(), MoveNode::isScheduled(), MoveNode::isSourceOperation(), TTAProgram::Terminal::isTriggering(), SimpleResourceManager::latestCycle(), DataDependenceGraph::latestCycle(), MoveNode::latestTriggerWriteCycle(), MoveNode::move(), DataDependenceGraph::moveFUDependenciesToTrigger(), MoveNodeGroup::node(), MoveNodeGroup::nodeCount(), BasicBlockScheduler::rm_, scheduleOperand(), MoveNode::sourceOperation(), BasicBlockScheduler::targetMachine_, MoveNode::toString(), BasicBlockScheduler::unschedule(), and BasicBlockScheduler::unscheduleInputOperandTempMoves().
Referenced by scheduleOperation().
|
protected |
Schedules moves in a single operation execution.
Assumes the given MoveNodeGroup contains all moves in the operation execution. Also assumes that all outputs of the MoveNodeGroup have been scheduled.
moves | Moves of the operation execution. |
Definition at line 455 of file BUBasicBlockScheduler.cc.
References __func__, RegisterCopyAdder::addMinimumRegisterCopies(), bypass_, RegisterCopyAdder::AddedRegisterCopies::count_, BasicBlockScheduler::ddg_, MoveNode::destinationOperation(), endCycle_, finalizeSchedule(), SimpleResourceManager::initiationInterval(), ProgramOperation::inputMove(), ProgramOperation::inputMoveCount(), SchedulerPass::interPassData(), MoveNode::isDestinationOperation(), MoveNode::isScheduled(), MoveNode::isSourceOperation(), Application::logStream(), BoostGraph< GraphNode, GraphEdge >::name(), MoveNodeGroup::node(), MoveNodeGroup::nodeCount(), RegisterCopyAdder::operandsScheduled(), ProgramOperation::outputMove(), ProgramOperation::outputMoveCount(), RegisterCopyAdder::resultsScheduled(), BasicBlockScheduler::rm_, scheduleOperandWrites(), scheduleResultReads(), BasicBlockScheduler::selector_, DataDependenceGraph::setCycleGrouping(), SimpleResourceManager::smallestCycle(), MoveNode::sourceOperation(), BasicBlockScheduler::targetMachine_, MoveNodeGroup::toString(), tryToSwitchInputs(), undoBypass(), BasicBlockScheduler::unschedule(), unscheduleAllNodes(), BasicBlockScheduler::unscheduleInputOperandTempMoves(), BasicBlockScheduler::unscheduleResultReadTempMoves(), and GraphBase< GraphNode, GraphEdge >::writeToDotFile().
Referenced by handleDDG(), and handleLoopDDG().
|
protected |
Schedules the result read moves of an operation execution.
Assumes the given MoveNodeGroup contains all moves in the operation execution.
moves | Moves of the operation execution. |
Definition at line 805 of file BUBasicBlockScheduler.cc.
References __func__, assert, bypassDistance_, bypassNode(), MoveNode::cycle(), BasicBlockScheduler::ddg_, TTAProgram::Move::destination(), dre_, DataDependenceGraph::firstScheduledRegisterWrite(), TTAProgram::Terminal::index(), MoveNode::isScheduled(), MoveNode::isSourceOperation(), MoveNode::move(), MoveNodeGroup::node(), MoveNodeGroup::nodeCount(), TTAProgram::Terminal::registerFile(), DataDependenceGraph::resultUsed(), scheduleMove(), scheduleResultReadTempMoves(), BasicBlockScheduler::succeedingTempMove(), MoveNode::toString(), undoBypass(), and BasicBlockScheduler::unschedule().
Referenced by scheduleOperation().
|
protected |
Schedules the (possible) temporary register copy moves (due to missing connectivity) preceeding the given result read move.
The function recursively goes through all the temporary moves added to the given result move.
resultMove | A temp move whose predecessor has to be scheduled. |
resultRead | The original move of which temp moves to schedule. |
firstWriteCycle | Recursive function parameter. |
Definition at line 1229 of file BUBasicBlockScheduler.cc.
References assert, bypass_, bypassNode(), MoveNode::cycle(), BasicBlockScheduler::ddg_, TTAProgram::Move::destination(), dre_, endCycle_, finalizeSchedule(), DataDependenceGraph::firstScheduledRegisterWrite(), TTAProgram::Terminal::index(), MoveNode::isScheduled(), MoveNode::move(), TTAProgram::Terminal::registerFile(), DataDependenceGraph::resultUsed(), BasicBlockScheduler::scheduledTempMoves_, scheduleMove(), BasicBlockScheduler::selector_, and BasicBlockScheduler::succeedingTempMove().
Referenced by scheduleResultReads(), scheduleRRMove(), and scheduleRRTempMoves().
|
protected |
Schedules moves in a single operation execution.
Assumes the given MoveNodeGroup contains all moves in the operation execution. Also assumes that all inputs to the MoveNodeGroup have been scheduled.
moveNode | R-R Move to schedule. |
Definition at line 912 of file BUBasicBlockScheduler.cc.
References RegisterCopyAdder::addRegisterCopiesToRRMove(), RegisterCopyAdder::AddedRegisterCopies::count_, BasicBlockScheduler::ddg_, TTAProgram::Move::destination(), endCycle_, TTAProgram::Terminal::equals(), SchedulerPass::interPassData(), MoveNode::move(), BoostGraph< GraphNode, GraphEdge >::name(), BasicBlockScheduler::rm_, scheduleMove(), scheduleResultReadTempMoves(), BasicBlockScheduler::selector_, DataDependenceGraph::setCycleGrouping(), TTAProgram::Move::source(), and GraphBase< GraphNode, GraphEdge >::writeToDotFile().
Referenced by handleDDG(), and handleLoopDDG().
|
protected |
Schedules the (possible) temporary register copy moves (due to missing connectivity) succeeding the given RR move.
The function recursively goes through all the temporary moves added to the given RR move.
regToRegMove | A temp move whose successor has to be scheduled. |
firstMove | The original move of which temp moves to schedule. |
lastUse | Recursive function parameter, it should be set as 0 for the first function call. |
Definition at line 1366 of file BUBasicBlockScheduler.cc.
References assert, bypass_, bypassNode(), MoveNode::cycle(), BasicBlockScheduler::ddg_, TTAProgram::Move::destination(), dre_, endCycle_, finalizeSchedule(), DataDependenceGraph::firstScheduledRegisterWrite(), TTAProgram::Terminal::index(), MoveNode::isScheduled(), MoveNode::move(), TTAProgram::Terminal::registerFile(), DataDependenceGraph::resultUsed(), BasicBlockScheduler::scheduledTempMoves_, scheduleMove(), scheduleResultReadTempMoves(), BasicBlockScheduler::selector_, BasicBlockScheduler::succeedingTempMove(), MoveNode::toString(), and GraphBase< GraphNode, GraphEdge >::writeToDotFile().
|
virtual |
A short description of the pass, usually the optimization name, such as "basic block scheduler".
Reimplemented from BasicBlockScheduler.
Definition at line 1197 of file BUBasicBlockScheduler.cc.
|
protected |
Tries to get rid of WaW dependence from unconditional to conditional.
if the conditional move's result is overwritten by the cond for all users, make the unconditional move conditional, with opposite guard.
Definition at line 1978 of file BUBasicBlockScheduler.cc.
References BoostGraph< GraphNode, GraphEdge >::connectNodes(), DataDependenceGraph::copyDepsOver(), DataDependenceGraph::copyIncomingGuardEdges(), DataDependenceGraph::copyOutgoingGuardWarEdges(), TTAProgram::CodeGenerator::createInverseGuard(), BasicBlockScheduler::ddg_, DataDependenceEdge::DEP_WAW, DataDependenceEdge::dependenceType(), DataDependenceEdge::EDGE_REGISTER, DataDependenceEdge::edgeReason(), endCycle_, DataDependenceGraph::exclusingGuards(), TTAProgram::Move::guard(), BoostGraph< GraphNode, GraphEdge >::inEdges(), MoveNode::isScheduled(), TTAProgram::Move::isUnconditional(), DataDependenceGraph::latestCycle(), MoveNode::move(), DataDependenceGraph::regRawSuccessors(), BoostGraph< GraphNode, GraphEdge >::removeEdge(), DataDependenceGraph::removeIncomingGuardEdges(), DataDependenceGraph::removeOutgoingGuardWarEdges(), scheduleMove(), TTAProgram::Move::setGuard(), BoostGraph< GraphNode, GraphEdge >::tailNode(), DataDependenceEdge::tailPseudo(), BasicBlockScheduler::targetMachine_, and BasicBlockScheduler::unschedule().
Referenced by scheduleMove().
|
protected |
If the operation is commutative, tries to change the operands so that the scheduler can schedule it better.
If the operation is not commutative, does nothing.
Which is better depends lots on the code being compiled and architecture which we are compiling for.
Current implementation tries to make constants triggers, and if there are no constant inputs, try to also change inputs so that last ready operand becomes trigger if it's near, but first ready operand becomes trigger if it's further (allows better bypassing of other operands) This seems to work in practice
po | programoperation whose inputs to switch |
Definition at line 1910 of file BUBasicBlockScheduler.cc.
References Operation::canSwap(), BasicBlockScheduler::ddg_, TTAProgram::Move::destination(), BasicBlockScheduler::getTriggerOperand(), SimpleResourceManager::initiationInterval(), ProgramOperation::inputMove(), ProgramOperation::inputMoveCount(), MoveNode::isSourceConstant(), DataDependenceGraph::latestCycle(), MoveNode::move(), Operation::numberOfInputs(), ProgramOperation::operation(), TTAProgram::Terminal::operationIndex(), BasicBlockScheduler::rm_, ProgramOperation::switchInputs(), and BasicBlockScheduler::targetMachine_.
Referenced by scheduleOperation().
|
protected |
Remove all the bypasses of result write in moveNode and restore and schedule original moves.
Definition at line 1528 of file BUBasicBlockScheduler.cc.
References assert, bypassDestinations_, bypassDestinationsBus_, bypassDestinationsCycle_, MapTools::containsKey(), BasicBlockScheduler::ddg_, droppedNodes_, MoveNode::isScheduled(), MoveNode::move(), scheduleMove(), TTAProgram::Move::setBus(), MoveNode::toString(), DataDependenceGraph::unMergeUser(), BasicBlockScheduler::unschedule(), and GraphBase< GraphNode, GraphEdge >::writeToDotFile().
Referenced by bypassNode(), handleDDG(), scheduleOperation(), and scheduleResultReads().
|
protected |
Calls unschedule() for all ddg nodes, which were scheduled and remove possible bypasses.
Definition at line 1841 of file BUBasicBlockScheduler.cc.
References assert, bypassDestinations_, bypassDestinationsBus_, bypassDestinationsCycle_, BasicBlockScheduler::ddg_, droppedNodes_, MoveNode::isScheduled(), DataDependenceGraph::scheduledMoves(), DataDependenceGraph::scheduledNodeCount(), DataDependenceGraph::unMergeUser(), and BasicBlockScheduler::unschedule().
Referenced by handleDDG(), handleLoopDDG(), and scheduleOperation().
|
protected |
Definition at line 155 of file BUBasicBlockScheduler.hh.
Referenced by bypassNode(), handleDDG(), handleLoopDDG(), scheduleOperation(), scheduleResultReadTempMoves(), and scheduleRRTempMoves().
|
protected |
Definition at line 145 of file BUBasicBlockScheduler.hh.
Referenced by bypassNode(), clearRemovedNodes(), finalizeSchedule(), undoBypass(), and unscheduleAllNodes().
|
protected |
Definition at line 151 of file BUBasicBlockScheduler.hh.
Referenced by bypassNode(), clearRemovedNodes(), undoBypass(), and unscheduleAllNodes().
|
protected |
Definition at line 147 of file BUBasicBlockScheduler.hh.
Referenced by bypassNode(), clearRemovedNodes(), undoBypass(), and unscheduleAllNodes().
|
protected |
Definition at line 157 of file BUBasicBlockScheduler.hh.
Referenced by bypassNode(), handleDDG(), handleLoopDDG(), and scheduleResultReads().
|
protected |
Definition at line 156 of file BUBasicBlockScheduler.hh.
Referenced by finalizeSchedule(), handleDDG(), handleLoopDDG(), scheduleResultReads(), scheduleResultReadTempMoves(), and scheduleRRTempMoves().
|
protected |
Definition at line 152 of file BUBasicBlockScheduler.hh.
Referenced by clearRemovedNodes(), finalizeSchedule(), undoBypass(), and unscheduleAllNodes().
|
protected |
Definition at line 154 of file BUBasicBlockScheduler.hh.
Referenced by handleDDG(), handleLoopDDG(), scheduleInputOperandTempMoves(), scheduleMove(), scheduleOperation(), scheduleResultReadTempMoves(), scheduleRRMove(), scheduleRRTempMoves(), and tryToOptimizeWaw().
|
protected |
Definition at line 142 of file BUBasicBlockScheduler.hh.
Referenced by BUBasicBlockScheduler(), handleLoopDDG(), and scheduleMove().