OpenASIP
2.0
|
#include <BBSchedulerController.hh>
Protected Member Functions | |
virtual DataDependenceGraph * | createDDGFromBB (TTAProgram::BasicBlock &bb, const TTAMachine::Machine &mach) |
Protected Member Functions inherited from BasicBlockPass | |
void | ddgSnapshot (DataDependenceGraph *ddg, std::string &name, DataDependenceGraph::DumpFileFormat format, bool final) |
Private Attributes | |
const TTAMachine::Machine & | targetMachine_ |
TTAProgram::Procedure * | scheduledProcedure_ |
The currently scheduled procedure. More... | |
ControlFlowGraph * | cfg_ |
Control flow graph of the procedure. More... | |
DataDependenceGraph * | bigDDG_ |
whole-procedure DDG. More... | |
SoftwareBypasser * | softwareBypasser_ |
The software bypasser to use to bypass registers when possible. More... | |
CopyingDelaySlotFiller * | delaySlotFiller_ |
int | basicBlocksScheduled_ |
Number of basic blocks scheduled so far. More... | |
int | totalBasicBlocks_ |
Total basic blocks in the CFG currently being scheduled. More... | |
boost::progress_display * | progressBar_ |
Fancy progress bar. Pointer because creation outputs the initial progress bar and we want it only on verbose mode. More... | |
LLVMTCECmdLineOptions * | options_ |
Additional Inherited Members | |
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 Public Member Functions inherited from ProcedurePass | |
static void | copyCfgToProcedure (TTAProgram::Procedure &procedure, ControlFlowGraph &cfg) |
static void | executeControlFlowGraphPass (TTAProgram::Procedure &procedure, const TTAMachine::Machine &targetmachine, ControlFlowGraphPass &cfgp) |
Static Public Member Functions inherited from ProgramPass | |
static void | executeProcedurePass (TTAProgram::Program &program, const TTAMachine::Machine &targetMachine, ProcedurePass &procedurePass) |
A class that control operation of a basic block scheduler.
This class handles calling other optimization passes and tranferring data for the actual BB scheduler and loop scheudlers etc.
Definition at line 62 of file BBSchedulerController.hh.
BBSchedulerController::BBSchedulerController | ( | const TTAMachine::Machine & | targetMachine, |
InterPassData & | data, | ||
SoftwareBypasser * | bypasser = NULL , |
||
CopyingDelaySlotFiller * | delaySlotFiller = NULL , |
||
DataDependenceGraph * | bigDDG = 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 92 of file BBSchedulerController.cc.
References Application::cmdLineOptions(), and options_.
|
virtual |
Definition at line 109 of file BBSchedulerController.cc.
References progressBar_.
|
protectedvirtual |
Helper function used to create DDG for BBPass.
Overrided version in order to use subgraphs.
bb | BasicBlock where DDG is to be created from |
Reimplemented from BasicBlockPass.
Definition at line 455 of file BBSchedulerController.cc.
References basicBlocksScheduled_, bigDDG_, DataDependenceGraphBuilder::build(), DataDependenceGraph::createSubgraph(), BasicBlockPass::ddgBuilder(), DataDependenceGraph::INTRA_BB_ANTIDEPS, TTAProgram::Procedure::name(), scheduledProcedure_, and Conversion::toString().
Referenced by executeDDGPass().
|
overridevirtual |
Creates a DDG from the given basic block and executes the set of DDG passes for that.
Reimplemented from BasicBlockPass.
Definition at line 472 of file BBSchedulerController.cc.
References abortWithError, CopyingDelaySlotFiller::addResourceManager(), ResourceConstraintAnalyzer::analyze(), ResourceConstraintAnalyzer::analyzePreSchedule(), bigDDG_, cfg_, SimpleResourceManager::clearOldResources(), BasicBlockPass::copyRMToBB(), createDDGFromBB(), SimpleResourceManager::createRM(), BasicBlockPass::ddgSnapshot(), debugLog, delaySlotFiller_, SimpleResourceManager::disposeRM(), Exception::errorMessageStack(), BoostGraph< GraphNode, GraphEdge >::height(), BasicBlockNode::isHWLoop(), TTAProgram::BasicBlock::isInInnerLoop(), DataDependenceGraph::largestCycle(), Application::logStream(), BoostGraph< GraphNode, GraphEdge >::name(), GraphNode::nodeID(), options_, BasicBlockNode::predecessor(), SchedulerCmdLineOptions::printResourceConstraints(), BoostGraph< GraphNode, GraphEdge >::rootGraph(), SimpleResourceManager::setBBN(), SimpleResourceManager::setCFG(), SimpleResourceManager::setDDG(), DataDependenceGraph::smallestCycle(), BasicBlockNode::updateHWloopLength(), and Application::verboseLevel().
Referenced by handleBasicBlock().
|
overridevirtual |
Schedules a single basic block.
bb | The basic block to schedule. |
targetMachine | The target machine. |
Exception | several TCE exceptions can be thrown in case of a scheduling error. |
Reimplemented from BasicBlockPass.
Definition at line 123 of file BBSchedulerController.cc.
References LoopAnalyzer::analyze(), BasicBlockNode::basicBlock(), basicBlocksScheduled_, bigDDG_, cfg_, Application::cmdLineOptions(), LoopAnalyzer::LoopAnalysisResult::counterMultiplier, LoopAnalyzer::LoopAnalysisResult::counterValueNode, executeDDGPass(), BasicBlockPass::executeLoopPass(), InterPassData::hasDatum(), TTAProgram::Instruction::hasJump(), TTAProgram::CodeSnippet::instructionCount(), SchedulerPass::interPassData(), SchedulerCmdLineOptions::isLoopOptDefined(), ControlFlowGraph::isSingleBBLoop(), LoopAnalyzer::LoopAnalysisResult::iterationCount, TTAProgram::CodeSnippet::lastInstruction(), TTAProgram::BasicBlock::liveRangeData_, Application::logStream(), options, options_, progressBar_, LiveRangeData::regDefines_, LiveRangeData::regDefReaches_, LiveRangeData::regFirstDefines_, LiveRangeData::regFirstUses_, LiveRangeData::registersUsedAfter_, LiveRangeData::regLastUses_, TTAProgram::BasicBlock::setTripCount(), softwareBypasser_, MachineConnectivityCheck::tempRegisterFiles(), BasicBlockNode::toString(), MoveNode::toString(), TTAProgram::BasicBlock::tripCount(), LLVMTCECmdLineOptions::useBubbleFish2Scheduler(), LLVMTCECmdLineOptions::useBUScheduler(), LLVMTCECmdLineOptions::useTDScheduler(), and Application::verboseLevel().
Referenced by handleBBNode().
bool BBSchedulerController::handleBBNode | ( | ControlFlowGraph & | cfg, |
BasicBlockNode & | bbn, | ||
const TTAMachine::Machine & | targetMachine, | ||
int | nodeCount | ||
) |
Definition at line 575 of file BBSchedulerController.cc.
References BasicBlockNode::basicBlock(), CopyingDelaySlotFiller::bbnScheduled(), bigDDG_, delaySlotFiller_, handleBasicBlock(), ControlFlowGraph::instructionReferenceManager(), BasicBlockNode::isNormalBB(), BasicBlockNode::isScheduled(), BoostGraph< GraphNode, GraphEdge >::name(), BoostGraph< GraphNode, GraphEdge >::nodeCount(), ControlFlowGraph::procedureName(), and BasicBlockNode::setScheduled().
Referenced by handleCFGDDG().
|
virtual |
Definition at line 603 of file BBSchedulerController.cc.
References ControlFlowGraph::allScheduledInBetween(), bigDDG_, cfg_, handleBBNode(), ScheduleEstimator::handleControlFlowGraph(), SchedulerPass::interPassData(), ControlFlowGraph::isSingleBBLoop(), ControlFlowGraph::jumpSuccessor(), BoostGraph< GraphNode, GraphEdge >::node(), and BoostGraph< GraphNode, GraphEdge >::nodeCount().
Referenced by llvm::LLVMTCEIRBuilder::compileOptimized(), and handleControlFlowGraph().
|
overridevirtual |
Schedules all nodes in a control flow graph.
The original control flow graph nodes are modified during scheduling.
cfg | The control flow graph to schedule. |
targetMachine | The target machine. |
Exception | In case of an error during scheduling. The exception type can be any subtype of Exception. |
Reimplemented from ControlFlowGraphPass.
Definition at line 398 of file BBSchedulerController.cc.
References bigDDG_, and handleCFGDDG().
Referenced by handleProcedure().
|
overridevirtual |
Schedules a procedure.
The original procedure is modified during scheduling.
procedure | The procedure to schedule. |
targetMachine | The target machine. |
Exception | In case of an error during scheduling. The exception type can be any subtype of Exception. |
Reimplemented from ProcedurePass.
Definition at line 284 of file BBSchedulerController.cc.
References basicBlocksScheduled_, bigDDG_, DataDependenceGraphBuilder::build(), TTAProgram::Procedure::clear(), Application::cmdLineOptions(), ControlFlowGraph::copyToProcedure(), BasicBlockPass::ddgBuilder(), DEFAULT_LOWMEM_MODE_THRESHOLD, delaySlotFiller_, LLVMTCECmdLineOptions::dumpDDGsDot(), LLVMTCECmdLineOptions::dumpDDGsXML(), CopyingDelaySlotFiller::fillDelaySlots(), CopyingDelaySlotFiller::finalizeProcedure(), handleControlFlowGraph(), CopyingDelaySlotFiller::initialize(), TTAProgram::CodeSnippet::instructionCount(), SchedulerPass::interPassData(), Application::logStream(), SchedulerCmdLineOptions::lowMemModeThreshold(), TTAProgram::Procedure::name(), BoostGraph< GraphNode, GraphEdge >::name(), BoostGraph< GraphNode, GraphEdge >::nodeCount(), options_, progressBar_, scheduledProcedure_, DataDependenceGraph::SINGLE_BB_LOOP_ANTIDEPS, totalBasicBlocks_, ControlFlowGraph::updateReferencesFromProcToCfg(), Application::verboseLevel(), GraphBase< GraphNode, GraphEdge >::writeToDotFile(), and DataDependenceGraph::writeToXMLFile().
Referenced by llvm::LLVMTCEIRBuilder::doFinalization().
|
overridevirtual |
Schedules a program.
The original program is modified during scheduling.
program | The program to schedule. |
targetMachine | The target machine. |
Exception | In case of an error during scheduling. The exception type can be any subtype of Exception. |
Reimplemented from ProgramPass.
Definition at line 414 of file BBSchedulerController.cc.
References ProgramPass::executeProcedurePass(), and program.
|
overridevirtual |
Optional longer description of the pass.
This description can include usage instructions, details of choice of algorithmic details, etc.
Reimplemented from SchedulerPass.
Definition at line 439 of file BBSchedulerController.cc.
|
overridevirtual |
A short description of the pass, usually the optimization name, such as "basic block scheduler".
Implements SchedulerPass.
Definition at line 426 of file BBSchedulerController.cc.
|
private |
Number of basic blocks scheduled so far.
Definition at line 130 of file BBSchedulerController.hh.
Referenced by createDDGFromBB(), handleBasicBlock(), and handleProcedure().
|
private |
whole-procedure DDG.
Definition at line 123 of file BBSchedulerController.hh.
Referenced by createDDGFromBB(), executeDDGPass(), handleBasicBlock(), handleBBNode(), handleCFGDDG(), handleControlFlowGraph(), and handleProcedure().
|
private |
Control flow graph of the procedure.
Definition at line 120 of file BBSchedulerController.hh.
Referenced by executeDDGPass(), handleBasicBlock(), and handleCFGDDG().
|
private |
Definition at line 127 of file BBSchedulerController.hh.
Referenced by executeDDGPass(), handleBBNode(), and handleProcedure().
|
private |
Definition at line 137 of file BBSchedulerController.hh.
Referenced by BBSchedulerController(), executeDDGPass(), handleBasicBlock(), and handleProcedure().
|
private |
Fancy progress bar. Pointer because creation outputs the initial progress bar and we want it only on verbose mode.
Definition at line 135 of file BBSchedulerController.hh.
Referenced by handleBasicBlock(), handleProcedure(), and ~BBSchedulerController().
|
private |
The currently scheduled procedure.
Definition at line 117 of file BBSchedulerController.hh.
Referenced by createDDGFromBB(), and handleProcedure().
|
private |
The software bypasser to use to bypass registers when possible.
Definition at line 125 of file BBSchedulerController.hh.
Referenced by handleBasicBlock().
|
private |
Definition at line 114 of file BBSchedulerController.hh.
|
private |
Total basic blocks in the CFG currently being scheduled.
Definition at line 132 of file BBSchedulerController.hh.
Referenced by handleProcedure().