OpenASIP 2.2
|
#include <BBSchedulerController.hh>
Protected Member Functions | |
virtual DataDependenceGraph * | createDDGFromBB (TTAProgram::BasicBlock &bb, const TTAMachine::Machine &mach) |
![]() | |
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. | |
ControlFlowGraph * | cfg_ |
Control flow graph of the procedure. | |
DataDependenceGraph * | bigDDG_ |
whole-procedure DDG. | |
SoftwareBypasser * | softwareBypasser_ |
The software bypasser to use to bypass registers when possible. | |
CopyingDelaySlotFiller * | delaySlotFiller_ |
int | basicBlocksScheduled_ |
Number of basic blocks scheduled so far. | |
int | totalBasicBlocks_ |
Total basic blocks in the CFG currently being scheduled. | |
LLVMTCECmdLineOptions * | options_ |
Additional Inherited Members | |
![]() | |
static void | copyRMToBB (SimpleResourceManager &rm, TTAProgram::BasicBlock &bb, const TTAMachine::Machine &targetMachine, TTAProgram::InstructionReferenceManager &irm, int lastCycle=-1) |
![]() | |
static void | copyCfgToProcedure (TTAProgram::Procedure &procedure, ControlFlowGraph &cfg) |
static void | executeControlFlowGraphPass (TTAProgram::Procedure &procedure, const TTAMachine::Machine &targetmachine, ControlFlowGraphPass &cfgp) |
![]() | |
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 60 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 90 of file BBSchedulerController.cc.
References Application::cmdLineOptions(), and options_.
|
virtual |
Definition at line 109 of file BBSchedulerController.cc.
|
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 438 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 455 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 121 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_, 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 558 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 586 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 381 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 277 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(), BoostGraph< GraphNode, GraphEdge >::name(), TTAProgram::Procedure::name(), BoostGraph< GraphNode, GraphEdge >::nodeCount(), options_, 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 397 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 422 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 409 of file BBSchedulerController.cc.
|
private |
Number of basic blocks scheduled so far.
Definition at line 128 of file BBSchedulerController.hh.
Referenced by createDDGFromBB(), handleBasicBlock(), and handleProcedure().
|
private |
whole-procedure DDG.
Definition at line 121 of file BBSchedulerController.hh.
Referenced by createDDGFromBB(), executeDDGPass(), handleBasicBlock(), handleBBNode(), handleCFGDDG(), handleControlFlowGraph(), and handleProcedure().
|
private |
Control flow graph of the procedure.
Definition at line 118 of file BBSchedulerController.hh.
Referenced by executeDDGPass(), handleBasicBlock(), and handleCFGDDG().
|
private |
Definition at line 125 of file BBSchedulerController.hh.
Referenced by executeDDGPass(), handleBBNode(), and handleProcedure().
|
private |
Definition at line 132 of file BBSchedulerController.hh.
Referenced by BBSchedulerController(), executeDDGPass(), handleBasicBlock(), and handleProcedure().
|
private |
The currently scheduled procedure.
Definition at line 115 of file BBSchedulerController.hh.
Referenced by createDDGFromBB(), and handleProcedure().
|
private |
The software bypasser to use to bypass registers when possible.
Definition at line 123 of file BBSchedulerController.hh.
Referenced by handleBasicBlock().
|
private |
Definition at line 112 of file BBSchedulerController.hh.
|
private |
Total basic blocks in the CFG currently being scheduled.
Definition at line 130 of file BBSchedulerController.hh.
Referenced by handleProcedure().