OpenASIP 2.2
|
#include <BasicBlockScheduler.hh>
Static Public Member Functions | |
static MoveNode * | findTrigger (const ProgramOperation &po, const TTAMachine::Machine &mach) |
![]() | |
static void | copyRMToBB (SimpleResourceManager &rm, TTAProgram::BasicBlock &bb, const TTAMachine::Machine &targetMachine, TTAProgram::InstructionReferenceManager &irm, int lastCycle=-1) |
Static Protected Member Functions | |
static MoveNode * | findTriggerFromUnit (const ProgramOperation &po, const TTAMachine::Unit &unit) |
Protected Attributes | |
const TTAMachine::Machine * | targetMachine_ |
The target machine we are scheduling the program against. | |
DataDependenceGraph * | ddg_ |
DDG of the currently scheduled BB. | |
SimpleResourceManager * | rm_ |
Resource Manager of the currently scheduled BB. | |
std::map< const MoveNode *, DataDependenceGraph::NodeSet > | scheduledTempMoves_ |
Stores the MoveNodes that were scheduled as temp moves during scheduling of the operand move. | |
SoftwareBypasser * | softwareBypasser_ |
The software bypasser to use to bypass registers when possible. | |
RegisterRenamer * | renamer_ |
int | minCycle_ |
The earliest cycle to schedule moves in. Used to leave room for sched_yield() by the sched_yield() emitter. | |
MoveNodeSelector * | selector_ |
int | bypassedCount_ |
int | deadResults_ |
LLVMTCECmdLineOptions * | options_ |
MoveNode * | jumpNode_ |
int | tripCount_ |
A class that implements the functionality of a 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 63 of file BasicBlockScheduler.hh.
BasicBlockScheduler::BasicBlockScheduler | ( | 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 |
Definition at line 83 of file BasicBlockScheduler.cc.
References Application::cmdLineOptions(), and options_.
|
virtual |
Definition at line 93 of file BasicBlockScheduler.cc.
|
inlinevirtual |
Reimplemented from BasicBlockPass.
Reimplemented in BUBasicBlockScheduler.
Definition at line 86 of file BasicBlockPass.hh.
|
protected |
Prints DDG to a dot file before and after scheudling
ddg | to print |
name | operation name for ddg |
final | specify if ddg is after scheduling |
resetCounter | |
format | format of the file |
Definition at line 1629 of file BasicBlockScheduler.cc.
References DataDependenceGraph::criticalPathGraph(), ddg_, DataDependenceGraph::DUMP_DOT, BoostGraph< GraphNode, GraphEdge >::name(), GraphBase< GraphNode, GraphEdge >::writeToDotFile(), and DataDependenceGraph::writeToXMLFile().
Referenced by BUBasicBlockScheduler::handleDDG(), handleDDG(), handleLoopDDG(), BUBasicBlockScheduler::handleLoopDDG(), and scheduleOperation().
|
static |
Definition at line 2090 of file BasicBlockScheduler.cc.
References TTAMachine::Machine::controlUnit(), TTAMachine::Machine::Navigator< ComponentType >::count(), findTriggerFromUnit(), TTAMachine::Machine::functionUnitNavigator(), TTAMachine::FunctionUnit::hasOperation(), TTAMachine::Machine::Navigator< ComponentType >::item(), Operation::name(), ProgramOperation::operation(), and ProgramOperation::triggeringMove().
Referenced by BFOptimization::getSisterTrigger(), BF2Scheduler::mustBeTrigger(), and BUBasicBlockScheduler::scheduleOperandWrites().
|
staticprotected |
Definition at line 2126 of file BasicBlockScheduler.cc.
References MoveNodeSet::at(), ProgramOperation::inputNode(), TTAMachine::HWOperation::io(), TTAMachine::FUPort::isTriggering(), Operation::name(), ProgramOperation::operation(), TTAMachine::FunctionUnit::operation(), TTAMachine::FunctionUnit::port(), and TTAMachine::Unit::portCount().
Referenced by findTrigger().
|
protected |
Returns the operand which is triggering in all FU's which support the operation. If operation not found, is not gcu or multiple FU's have different triggers, returns 0
Definition at line 1680 of file BasicBlockScheduler.cc.
References TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::functionUnitNavigator(), TTAMachine::FunctionUnit::hasOperation(), TTAMachine::FUPort::isTriggering(), TTAMachine::Machine::Navigator< ComponentType >::item(), machine, Operation::name(), Operation::numberOfInputs(), TTAMachine::FunctionUnit::operation(), and TTAMachine::HWOperation::port().
Referenced by tryToSwitchInputs(), and BUBasicBlockScheduler::tryToSwitchInputs().
|
overridevirtual |
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 DDGPass.
Reimplemented in BUBasicBlockScheduler.
Definition at line 107 of file BasicBlockScheduler.cc.
References __func__, SoftwareBypasser::bypassNode(), CriticalPathBBMoveNodeSelector::candidates(), SoftwareBypasser::clearCaches(), ddg_, ddgSnapshot(), TTAProgram::Move::destination(), DataDependenceGraph::DUMP_DOT, DataDependenceGraph::DUMP_XML, LLVMTCECmdLineOptions::dumpDDGsDot(), LLVMTCECmdLineOptions::dumpDDGsXML(), TTAProgram::Terminal::equals(), RegisterRenamer::initialize(), MoveNode::isMove(), MoveNode::isOperationMove(), TTAProgram::Terminal::isRA(), MoveNodeGroup::isScheduled(), SimpleResourceManager::largestCycle(), minCycle_, MoveNode::move(), BoostGraph< GraphNode, GraphEdge >::node(), MoveNodeGroup::node(), MoveNodeGroup::nodeCount(), BoostGraph< GraphNode, GraphEdge >::nodeCount(), notifyScheduled(), options_, SoftwareBypasser::removeBypass(), SoftwareBypasser::removeDeadResults(), renamer_, rm_, DataDependenceGraph::scheduledNodeCount(), scheduledTempMoves_, scheduleMove(), scheduleOperation(), scheduleRRMove(), selector_, RegisterRenamer::setSelector(), SoftwareBypasser::setSelector(), softwareBypasser_, TTAProgram::Move::source(), targetMachine_, MoveNode::toString(), tripCount_, unscheduleAllNodes(), and GraphBase< GraphNode, GraphEdge >::writeToDotFile().
|
overridevirtual |
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 DDGPass.
Reimplemented in BUBasicBlockScheduler.
Definition at line 251 of file BasicBlockScheduler.cc.
References abortWithError, MoveNodeGroup::addNode(), CriticalPathBBMoveNodeSelector::candidates(), SoftwareBypasser::clearCaches(), ddg_, ddgSnapshot(), debugLog, TTAProgram::Move::destination(), DataDependenceGraph::DUMP_DOT, DataDependenceGraph::DUMP_XML, LLVMTCECmdLineOptions::dumpDDGsDot(), LLVMTCECmdLineOptions::dumpDDGsXML(), RegisterRenamer::initialize(), SimpleResourceManager::initiationInterval(), TTAProgram::Move::isControlFlowMove(), MoveNode::isMove(), MoveNode::isOperationMove(), TTAProgram::Terminal::isRA(), MoveNodeGroup::isScheduled(), jumpNode_, DataDependenceGraph::largestCycle(), Application::logStream(), minCycle_, MoveNode::move(), BoostGraph< GraphNode, GraphEdge >::node(), MoveNodeGroup::node(), MoveNodeGroup::nodeCount(), BoostGraph< GraphNode, GraphEdge >::nodeCount(), notifyScheduled(), options_, renamer_, rm_, DataDependenceGraph::scheduledNodeCount(), scheduledTempMoves_, scheduleMove(), scheduleOperation(), scheduleRRMove(), RegisterRenamer::setSelector(), SoftwareBypasser::setSelector(), softwareBypasser_, targetMachine_, Conversion::toString(), tripCount_, unscheduleAllNodes(), and GraphBase< GraphNode, GraphEdge >::writeToDotFile().
|
protected |
Checks if the result moves that were removed might remove some resource bottleneck of already scheduled moves.
This situation happens at least when a result move used the last RF write port for a cycle and limited the earliest cycle of a previously scheduled move. Thus, after the last use of that result was scheduled and bypassed, the RF write port is freed as the result move becomes unnecessary, thus the move that was scheduled before could be scheduled earlier. Same thing can happen for bus (move slot) contrained moves and also moves that were restricted by a WaR edge due to the result move, etc.
Definition at line 1803 of file BasicBlockScheduler.cc.
References assert, MoveNode::cycle(), ddg_, TTAProgram::Move::destination(), SimpleResourceManager::instruction(), TTAProgram::Terminal::isGPR(), MoveNode::isScheduled(), Application::logStream(), MoveNode::move(), DataDependenceGraph::movesAtCycle(), TTAProgram::Terminal::registerFile(), rm_, scheduleMove(), TTAProgram::Instruction::toString(), TTAProgram::Move::toString(), MoveNode::toString(), and unschedule().
Referenced by scheduleOperation().
|
virtual |
Optional longer description of the pass.
This description can include usage instructions, details of choice of algorithmic details, etc.
Reimplemented from SchedulerPass.
Reimplemented in BUBasicBlockScheduler.
Definition at line 1583 of file BasicBlockScheduler.cc.
|
protected |
Notifies to the selector that given nodes and their temp reg copies are scheduled .
nodes | nodes which are scheduled. |
selector | selector which to notify. |
Definition at line 1598 of file BasicBlockScheduler.cc.
References MoveNodeGroup::node(), MoveNodeGroup::nodeCount(), MoveNodeSelector::notifyScheduled(), and scheduledTempMoves_.
Referenced by handleDDG(), handleLoopDDG(), and BUBasicBlockScheduler::handleLoopDDG().
|
virtual |
Definition at line 1904 of file BasicBlockScheduler.cc.
References Application::verboseLevel().
|
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 1340 of file BasicBlockScheduler.cc.
References TTAProgram::ProgramAnnotation::ANN_CONNECTIVITY_MOVE, assert, MoveNode::cycle(), ddg_, DataDependenceEdge::DEP_RAW, TTAProgram::Move::destination(), DataDependenceEdge::EDGE_REGISTER, TTAProgram::AnnotatedInstructionElement::hasAnnotations(), TTAProgram::Terminal::index(), BoostGraph< GraphNode, GraphEdge >::inEdges(), MoveNode::isScheduled(), DataDependenceGraph::lastScheduledRegisterRead(), MoveNode::move(), TTAProgram::Terminal::registerFile(), scheduledTempMoves_, scheduleInputOperandTempMoves(), scheduleMove(), and BoostGraph< GraphNode, GraphEdge >::tailNode().
Referenced by scheduleInputOperandTempMoves(), and scheduleOperandWrites().
|
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. |
allowPredicationAndRenaming | Whether allowed to remove guard from the move being scheduled. Checks again side-effects are still made, this can be done only to operand moves and triggers without mem write or side-effects. |
Definition at line 946 of file BasicBlockScheduler.cc.
References __func__, MoveNodeSet::addMoveNode(), Operation::affectsCount(), TTAProgram::ProgramAnnotation::ANN_REQUIRES_LIMM, TTAProgram::ProgramAnnotation::ANN_STACKFRAME_PROCEDURE_RETURN, assert, SimpleResourceManager::assign(), SimpleResourceManager::canTransportImmediate(), TTAMachine::Machine::controlUnit(), MoveNode::cycle(), ddg_, TTAMachine::ControlUnit::delaySlots(), TTAProgram::Move::destination(), MoveNode::destinationOperation(), DataDependenceGraph::earliestCycle(), SimpleResourceManager::earliestCycle(), MoveNode::earliestResultReadCycle(), Exception::errorMessageStack(), DataDependenceGraph::findLimitingAntidependenceSource(), DataDependenceGraph::findLoopLimitAndIndex(), MoveNode::guardLatency(), TTAProgram::AnnotatedInstructionElement::hasAnnotations(), Operation::hasSideEffects(), SimpleResourceManager::initiationInterval(), TTAProgram::Move::isControlFlowMove(), MoveNode::isDestinationOperation(), TTAProgram::Terminal::isGPR(), TTAProgram::Move::isReturn(), MoveNode::isScheduled(), MoveNode::isSourceConstant(), MoveNode::isSourceOperation(), TTAProgram::Move::isUnconditional(), jumpNode_, DataDependenceGraph::largestCycle(), SimpleResourceManager::largestCycle(), DataDependenceGraph::latestCycle(), minCycle_, MoveNode::move(), BoostGraph< GraphNode, GraphEdge >::nodeCount(), ProgramOperation::operation(), DataDependenceGraph::removeIncomingGuardEdges(), RegisterRenamer::renameDestinationRegister(), renamer_, RegisterRenamer::renameSourceRegister(), rm_, DataDependenceGraph::scheduledNodeCount(), scheduleMove(), TTAProgram::AnnotatedInstructionElement::setAnnotation(), TTAProgram::Move::setGuard(), TTAProgram::Move::setSource(), TTAProgram::Move::source(), MoveNode::sourceOperation(), targetMachine_, MoveNode::toString(), Conversion::toString(), tripCount_, tryToOptimizeWaw(), unschedule(), unscheduleAllNodes(), DataDependenceGraph::unscheduledMoves(), SimValue::unsignedValue(), TTAProgram::TerminalImmediate::value(), SimValue::width(), Operation::writesMemory(), and GraphBase< GraphNode, GraphEdge >::writeToDotFile().
Referenced by handleDDG(), handleLoopDDG(), handleRemovedResultMoves(), scheduleInputOperandTempMoves(), scheduleMove(), scheduleOperandWrites(), scheduleResultReads(), scheduleResultReadTempMoves(), scheduleRRMove(), scheduleRRTempMoves(), and tryToOptimizeWaw().
|
protected |
Schedules operand moves of an operation execution.
Assumes the given MoveNodeGroup contains all moves in the operation execution. Also assumes that all inputs to the MoveNodeGroup have been scheduled. Exception to this are the possible temporary register copies inserted before the operand move due to missing connectivity. If found, the temp moves are scheduled atomically with the operand move. Assumes top-down scheduling.
cycle | Earliest cycle for starting scheduling of operands. This parameter is modified to the highest cycle one should try next in case scheduling starting from the given cycle failed. |
moves | Moves of the operation execution. |
Definition at line 629 of file BasicBlockScheduler.cc.
References __func__, assert, MoveNode::cycle(), ddg_, TTAProgram::Move::destination(), DataDependenceGraph::earliestCycle(), SimpleResourceManager::earliestCycle(), SimpleResourceManager::initiationInterval(), MoveNode::isDestinationOperation(), MoveNode::isScheduled(), MoveNode::isSourceOperation(), TTAProgram::Terminal::isTriggering(), MoveNode::move(), MoveNodeGroup::node(), MoveNodeGroup::nodeCount(), rm_, scheduleInputOperandTempMoves(), scheduleMove(), MoveNodeGroup::toString(), MoveNode::toString(), Conversion::toString(), unschedule(), unscheduleAllNodes(), unscheduleInputOperandTempMoves(), and GraphBase< GraphNode, GraphEdge >::writeToDotFile().
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 inputs to the MoveNodeGroup have been scheduled.
moves | Moves of the operation execution. |
Definition at line 397 of file BasicBlockScheduler.cc.
References __func__, RegisterCopyAdder::addMinimumRegisterCopies(), MoveNodeSet::addMoveNode(), SoftwareBypasser::bypass(), RegisterCopyAdder::AddedRegisterCopies::count_, ddg_, ddgSnapshot(), MoveNode::destinationOperation(), DataDependenceGraph::DUMP_DOT, DataDependenceGraph::DUMP_XML, LLVMTCECmdLineOptions::dumpDDGsDot(), Exception::errorMessageStack(), handleRemovedResultMoves(), SimpleResourceManager::initiationInterval(), SchedulerPass::interPassData(), MoveNode::isDestinationOperation(), MoveNode::isScheduled(), MoveNode::isSourceOperation(), SimpleResourceManager::largestCycle(), Application::logStream(), BoostGraph< GraphNode, GraphEdge >::name(), MoveNodeGroup::node(), MoveNodeGroup::nodeCount(), RegisterCopyAdder::operandsScheduled(), options_, SoftwareBypasser::removeBypass(), SoftwareBypasser::removeDeadResults(), RegisterCopyAdder::resultsScheduled(), rm_, DataDependenceGraph::sanityCheck(), scheduleOperandWrites(), scheduleResultReads(), selector_, DataDependenceGraph::setCycleGrouping(), softwareBypasser_, MoveNode::sourceOperation(), targetMachine_, MoveNodeGroup::toString(), Conversion::toString(), tryToSwitchInputs(), unschedule(), unscheduleAllNodes(), unscheduleInputOperandTempMoves(), 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. Also assumes that all operand moves have been scheduled.
moves | Moves of the operation execution. |
Definition at line 843 of file BasicBlockScheduler.cc.
References __func__, MoveNode::cycle(), ddg_, TTAProgram::Move::destination(), TTAProgram::Terminal::index(), MoveNode::isScheduled(), MoveNode::isSourceOperation(), DataDependenceGraph::lastScheduledRegisterRead(), MoveNode::move(), MoveNodeGroup::node(), MoveNodeGroup::nodeCount(), TTAProgram::Terminal::registerFile(), scheduleMove(), scheduleResultReadTempMoves(), succeedingTempMove(), and MoveNode::toString().
Referenced by scheduleOperation().
|
protected |
Schedules the (possible) temporary register copy moves (due to missing connectivity) succeeding the given result read move.
The function recursively goes through all the temporary moves added to the given input move.
resultMove | A temp move whose successor has to be scheduled. |
resultRead | 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 1438 of file BasicBlockScheduler.cc.
References assert, MoveNode::cycle(), ddg_, TTAProgram::Move::destination(), TTAProgram::Terminal::index(), MoveNode::isScheduled(), DataDependenceGraph::lastScheduledRegisterRead(), MoveNode::move(), TTAProgram::Terminal::registerFile(), scheduledTempMoves_, scheduleMove(), scheduleResultReadTempMoves(), and succeedingTempMove().
Referenced by scheduleResultReads(), scheduleResultReadTempMoves(), 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 898 of file BasicBlockScheduler.cc.
References RegisterCopyAdder::addRegisterCopiesToRRMove(), RegisterCopyAdder::AddedRegisterCopies::count_, ddg_, SchedulerPass::interPassData(), BoostGraph< GraphNode, GraphEdge >::name(), rm_, DataDependenceGraph::sanityCheck(), scheduleMove(), scheduleRRTempMoves(), selector_, DataDependenceGraph::setCycleGrouping(), 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 1293 of file BasicBlockScheduler.cc.
References assert, MoveNode::cycle(), ddg_, TTAProgram::Move::destination(), TTAProgram::Terminal::index(), MoveNode::isScheduled(), DataDependenceGraph::lastScheduledRegisterRead(), MoveNode::move(), TTAProgram::Terminal::registerFile(), scheduledTempMoves_, scheduleMove(), scheduleResultReadTempMoves(), and succeedingTempMove().
Referenced by scheduleRRMove().
|
virtual |
A short description of the pass, usually the optimization name, such as "basic block scheduler".
Implements SchedulerPass.
Reimplemented in BUBasicBlockScheduler.
Definition at line 1570 of file BasicBlockScheduler.cc.
Finds the temp move succeeding the given movenode.
If it does not have one , returns null.
current | MoveNode whose tempmoves we are searching |
Definition at line 1406 of file BasicBlockScheduler.cc.
References TTAProgram::ProgramAnnotation::ANN_CONNECTIVITY_MOVE, assert, ddg_, TTAProgram::AnnotatedInstructionElement::hasAnnotations(), MoveNode::isScheduled(), MoveNode::move(), and BoostGraph< GraphNode, GraphEdge >::successors().
Referenced by BUBasicBlockScheduler::bypassNode(), scheduleResultReads(), BUBasicBlockScheduler::scheduleResultReads(), scheduleResultReadTempMoves(), BUBasicBlockScheduler::scheduleResultReadTempMoves(), scheduleRRTempMoves(), and BUBasicBlockScheduler::scheduleRRTempMoves().
|
protected |
Definition at line 2017 of file BasicBlockScheduler.cc.
References assert, SimpleResourceManager::assign(), MoveNode::cycle(), ddg_, MoveNode::isDestinationOperation(), TTAProgram::Move::isTriggering(), DataDependenceGraph::latestCycle(), SimpleResourceManager::latestCycle(), MoveNode::move(), MoveNodeGroup::node(), MoveNodeGroup::nodeCount(), rm_, and SimpleResourceManager::unassign().
|
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 1916 of file BasicBlockScheduler.cc.
References assert, BoostGraph< GraphNode, GraphEdge >::connectNodes(), DataDependenceGraph::copyDepsOver(), DataDependenceGraph::copyIncomingGuardEdges(), DataDependenceGraph::copyOutgoingGuardWarEdges(), TTAProgram::CodeGenerator::createInverseGuard(), MoveNode::cycle(), ddg_, DataDependenceEdge::DEP_WAW, DataDependenceEdge::dependenceType(), DataDependenceGraph::earliestCycle(), DataDependenceEdge::EDGE_REGISTER, DataDependenceEdge::edgeReason(), DataDependenceGraph::exclusingGuards(), TTAProgram::Move::guard(), DataDependenceGraph::guardDefMoves(), MoveNode::guardLatency(), BoostGraph< GraphNode, GraphEdge >::inEdges(), MoveNode::isScheduled(), TTAProgram::Move::isUnconditional(), MoveNode::move(), DataDependenceGraph::regRawSuccessors(), BoostGraph< GraphNode, GraphEdge >::removeEdge(), DataDependenceGraph::removeIncomingGuardEdges(), DataDependenceGraph::removeOutgoingGuardWarEdges(), scheduleMove(), TTAProgram::Move::setGuard(), BoostGraph< GraphNode, GraphEdge >::tailNode(), DataDependenceEdge::tailPseudo(), targetMachine_, and 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 1730 of file BasicBlockScheduler.cc.
References Operation::canSwap(), ddg_, TTAProgram::Move::destination(), DataDependenceGraph::earliestCycle(), getTriggerOperand(), SimpleResourceManager::initiationInterval(), ProgramOperation::inputMove(), ProgramOperation::inputMoveCount(), MoveNode::isSourceConstant(), MoveNode::move(), Operation::numberOfInputs(), ProgramOperation::operation(), TTAProgram::Terminal::operationIndex(), rm_, ProgramOperation::switchInputs(), and targetMachine_.
Referenced by scheduleOperation().
|
protected |
Unschedules the given move.
Also restores a possible short immediate source in case it was converted to a long immediate register read during scheduling.
moveNode | Move to unschedule. |
Definition at line 1484 of file BasicBlockScheduler.cc.
References __func__, TTAProgram::ProgramAnnotation::ANN_REQUIRES_LIMM, TTAProgram::AnnotatedInstructionElement::hasAnnotations(), MoveNode::isPlaced(), MoveNode::isScheduled(), MoveNode::move(), TTAProgram::AnnotatedInstructionElement::removeAnnotations(), rm_, MoveNode::toString(), and SimpleResourceManager::unassign().
Referenced by BUBasicBlockScheduler::bypassNode(), handleRemovedResultMoves(), scheduleMove(), scheduleOperandWrites(), BUBasicBlockScheduler::scheduleOperandWrites(), scheduleOperation(), BUBasicBlockScheduler::scheduleOperation(), BUBasicBlockScheduler::scheduleResultReads(), tryToOptimizeWaw(), BUBasicBlockScheduler::tryToOptimizeWaw(), BUBasicBlockScheduler::undoBypass(), unscheduleAllNodes(), BUBasicBlockScheduler::unscheduleAllNodes(), unscheduleInputOperandTempMoves(), and unscheduleResultReadTempMoves().
|
protected |
Calls unschedule() for all ddg nodes, which are scheduled.
Definition at line 1507 of file BasicBlockScheduler.cc.
References SoftwareBypasser::clearCaches(), ddg_, SoftwareBypasser::removeBypass(), rm_, DataDependenceGraph::scheduledMoves(), softwareBypasser_, and unschedule().
Referenced by handleDDG(), handleLoopDDG(), scheduleMove(), scheduleOperandWrites(), and scheduleOperation().
|
protected |
Unschedules the (possible) temporary register copy moves (due to missing connectivity) preceeding the given move.
operandMove | The move of which temp moves to unschedule. |
Definition at line 1528 of file BasicBlockScheduler.cc.
References MapTools::containsKey(), scheduledTempMoves_, and unschedule().
Referenced by scheduleOperandWrites(), BUBasicBlockScheduler::scheduleOperandWrites(), scheduleOperation(), and BUBasicBlockScheduler::scheduleOperation().
|
protected |
Unschedules the (possible) temporary register copy moves (due to missing connectivity) succeeding the given result read move.
resultMove | The move of which temp moves to unschedule. |
Definition at line 1549 of file BasicBlockScheduler.cc.
References MapTools::containsKey(), scheduledTempMoves_, and unschedule().
Referenced by scheduleOperation(), and BUBasicBlockScheduler::scheduleOperation().
|
protected |
Definition at line 165 of file BasicBlockScheduler.hh.
|
protected |
DDG of the currently scheduled BB.
Definition at line 149 of file BasicBlockScheduler.hh.
Referenced by BUBasicBlockScheduler::bypassNode(), BUBasicBlockScheduler::clearRemovedNodes(), ddgSnapshot(), BUBasicBlockScheduler::finalizeSchedule(), BUBasicBlockScheduler::findBypassDestinations(), BUBasicBlockScheduler::handleDDG(), handleDDG(), handleLoopDDG(), BUBasicBlockScheduler::handleLoopDDG(), handleRemovedResultMoves(), BUBasicBlockScheduler::precedingTempMove(), scheduleInputOperandTempMoves(), BUBasicBlockScheduler::scheduleInputOperandTempMoves(), BUBasicBlockScheduler::scheduleMove(), scheduleMove(), BUBasicBlockScheduler::scheduleOperand(), scheduleOperandWrites(), BUBasicBlockScheduler::scheduleOperandWrites(), scheduleOperation(), BUBasicBlockScheduler::scheduleOperation(), scheduleResultReads(), BUBasicBlockScheduler::scheduleResultReads(), scheduleResultReadTempMoves(), BUBasicBlockScheduler::scheduleResultReadTempMoves(), scheduleRRMove(), BUBasicBlockScheduler::scheduleRRMove(), scheduleRRTempMoves(), BUBasicBlockScheduler::scheduleRRTempMoves(), succeedingTempMove(), tryToDelayOperands(), tryToOptimizeWaw(), BUBasicBlockScheduler::tryToOptimizeWaw(), tryToSwitchInputs(), BUBasicBlockScheduler::tryToSwitchInputs(), BUBasicBlockScheduler::undoBypass(), unscheduleAllNodes(), and BUBasicBlockScheduler::unscheduleAllNodes().
|
protected |
Definition at line 166 of file BasicBlockScheduler.hh.
|
protected |
Definition at line 170 of file BasicBlockScheduler.hh.
Referenced by handleLoopDDG(), and scheduleMove().
|
protected |
The earliest cycle to schedule moves in. Used to leave room for sched_yield() by the sched_yield() emitter.
Definition at line 162 of file BasicBlockScheduler.hh.
Referenced by handleDDG(), handleLoopDDG(), BUBasicBlockScheduler::handleLoopDDG(), and scheduleMove().
|
protected |
Definition at line 168 of file BasicBlockScheduler.hh.
Referenced by BasicBlockScheduler(), BUBasicBlockScheduler::BUBasicBlockScheduler(), BUBasicBlockScheduler::handleDDG(), handleDDG(), handleLoopDDG(), BUBasicBlockScheduler::handleLoopDDG(), and scheduleOperation().
|
protected |
Definition at line 158 of file BasicBlockScheduler.hh.
Referenced by BUBasicBlockScheduler::handleDDG(), handleDDG(), handleLoopDDG(), BUBasicBlockScheduler::handleLoopDDG(), BUBasicBlockScheduler::scheduleMove(), and scheduleMove().
|
protected |
Resource Manager of the currently scheduled BB.
Definition at line 151 of file BasicBlockScheduler.hh.
Referenced by BUBasicBlockScheduler::bypassNode(), BUBasicBlockScheduler::findBypassDestinations(), BUBasicBlockScheduler::handleDDG(), handleDDG(), handleLoopDDG(), BUBasicBlockScheduler::handleLoopDDG(), handleRemovedResultMoves(), BUBasicBlockScheduler::scheduleMove(), scheduleMove(), scheduleOperandWrites(), BUBasicBlockScheduler::scheduleOperandWrites(), scheduleOperation(), BUBasicBlockScheduler::scheduleOperation(), scheduleRRMove(), BUBasicBlockScheduler::scheduleRRMove(), tryToDelayOperands(), tryToSwitchInputs(), BUBasicBlockScheduler::tryToSwitchInputs(), unschedule(), and unscheduleAllNodes().
|
protected |
Stores the MoveNodes that were scheduled as temp moves during scheduling of the operand move.
Definition at line 154 of file BasicBlockScheduler.hh.
Referenced by BUBasicBlockScheduler::finalizeSchedule(), handleDDG(), handleLoopDDG(), BUBasicBlockScheduler::handleLoopDDG(), notifyScheduled(), scheduleInputOperandTempMoves(), BUBasicBlockScheduler::scheduleInputOperandTempMoves(), scheduleResultReadTempMoves(), BUBasicBlockScheduler::scheduleResultReadTempMoves(), scheduleRRTempMoves(), BUBasicBlockScheduler::scheduleRRTempMoves(), unscheduleInputOperandTempMoves(), and unscheduleResultReadTempMoves().
|
protected |
Definition at line 164 of file BasicBlockScheduler.hh.
Referenced by BUBasicBlockScheduler::handleDDG(), handleDDG(), scheduleOperation(), BUBasicBlockScheduler::scheduleOperation(), BUBasicBlockScheduler::scheduleResultReadTempMoves(), scheduleRRMove(), BUBasicBlockScheduler::scheduleRRMove(), and BUBasicBlockScheduler::scheduleRRTempMoves().
|
protected |
The software bypasser to use to bypass registers when possible.
Definition at line 156 of file BasicBlockScheduler.hh.
Referenced by handleDDG(), handleLoopDDG(), scheduleOperation(), and unscheduleAllNodes().
|
protected |
The target machine we are scheduling the program against.
Definition at line 147 of file BasicBlockScheduler.hh.
Referenced by BUBasicBlockScheduler::handleDDG(), handleDDG(), handleLoopDDG(), BUBasicBlockScheduler::handleLoopDDG(), BUBasicBlockScheduler::scheduleMove(), scheduleMove(), BUBasicBlockScheduler::scheduleOperandWrites(), scheduleOperation(), BUBasicBlockScheduler::scheduleOperation(), tryToOptimizeWaw(), BUBasicBlockScheduler::tryToOptimizeWaw(), tryToSwitchInputs(), and BUBasicBlockScheduler::tryToSwitchInputs().
|
protected |
Definition at line 172 of file BasicBlockScheduler.hh.
Referenced by handleDDG(), handleLoopDDG(), BUBasicBlockScheduler::handleLoopDDG(), and scheduleMove().