OpenASIP
2.0
|
#include <BasicBlockPass.hh>
Public Member Functions | |
BasicBlockPass (InterPassData &data) | |
virtual | ~BasicBlockPass () |
virtual void | handleBasicBlock (TTAProgram::BasicBlock &basicBlock, const TTAMachine::Machine &targetMachine, TTAProgram::InstructionReferenceManager &irm, BasicBlockNode *bbn=NULL) |
virtual void | executeDDGPass (TTAProgram::BasicBlock &bb, const TTAMachine::Machine &targetMachine, TTAProgram::InstructionReferenceManager &irm, std::vector< DDGPass * > ddgPasses, BasicBlockNode *bbn=NULL) |
virtual bool | executeLoopPass (TTAProgram::BasicBlock &bb, const TTAMachine::Machine &targetMachine, TTAProgram::InstructionReferenceManager &irm, std::vector< DDGPass * > ddgPasses, BasicBlockNode *bbn=NULL) |
virtual DataDependenceGraphBuilder & | ddgBuilder () |
Public Member Functions inherited from SchedulerPass | |
SchedulerPass (InterPassData &data) | |
virtual | ~SchedulerPass () |
InterPassData & | interPassData () |
virtual std::string | shortDescription () const =0 |
virtual std::string | longDescription () const |
Static Public Member Functions | |
static void | copyRMToBB (SimpleResourceManager &rm, TTAProgram::BasicBlock &bb, const TTAMachine::Machine &targetMachine, TTAProgram::InstructionReferenceManager &irm, int lastCycle=-1) |
Protected Member Functions | |
void | ddgSnapshot (DataDependenceGraph *ddg, std::string &name, DataDependenceGraph::DumpFileFormat format, bool final) |
virtual DataDependenceGraph * | createDDGFromBB (TTAProgram::BasicBlock &bb, const TTAMachine::Machine &mach) |
Private Attributes | |
DataDependenceGraphBuilder | ddgBuilder_ |
Interface for scheduler passes that handle basic blocks.
Definition at line 60 of file BasicBlockPass.hh.
BasicBlockPass::BasicBlockPass | ( | InterPassData & | data | ) |
Constructor.
Definition at line 51 of file BasicBlockPass.cc.
|
virtual |
|
static |
Copies moves back from resourcemanager to basicblock, putting them to correct instructions based in their cycle, and adding the final delay slots.
rm | the resourcemanager |
bb | the basicblock |
targetMachine | machine we are scheduling for. |
irm | IRM to keep book of the instruction references. |
lastCycle | the last instruction cycle of BB to copy. |
Definition at line 213 of file BasicBlockPass.cc.
References TTAProgram::CodeSnippet::add(), assert, TTAMachine::Machine::busNavigator(), TTAProgram::BasicBlock::clear(), TTAMachine::Machine::controlUnit(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::ControlUnit::delaySlots(), TTAProgram::CodeSnippet::firstInstruction(), TTAProgram::Instruction::hasControlFlowMove(), TTAProgram::InstructionReferenceManager::hasReference(), SimpleResourceManager::initiationInterval(), SimpleResourceManager::instruction(), TTAProgram::CodeSnippet::instructionAtIndex(), TTAProgram::CodeSnippet::instructionCount(), TTAProgram::Instruction::instructionTemplate(), TTAProgram::BasicBlock::isInInnerLoop(), SimpleResourceManager::largestCycle(), Application::logStream(), SimpleResourceManager::loseInstructionOwnership(), TTAProgram::Instruction::moveCount(), TTAMachine::Component::name(), TTAProgram::InstructionReferenceManager::replace(), SimpleResourceManager::smallestCycle(), TTAProgram::Instruction::toString(), TTAProgram::BasicBlock::tripCount(), and Application::verboseLevel().
Referenced by LoopPrologAndEpilogBuilder::addPrologFromRM(), executeDDGPass(), BBSchedulerController::executeDDGPass(), and SequentialScheduler::handleBasicBlock().
|
protectedvirtual |
Reimplemented in BBSchedulerController.
Definition at line 302 of file BasicBlockPass.cc.
References DataDependenceGraphBuilder::build(), ddgBuilder(), and DataDependenceGraph::INTRA_BB_ANTIDEPS.
Referenced by executeDDGPass().
|
inlinevirtual |
Definition at line 86 of file BasicBlockPass.hh.
References ddgBuilder_.
Referenced by createDDGFromBB(), BBSchedulerController::createDDGFromBB(), and BBSchedulerController::handleProcedure().
|
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 |
format | format of the file |
Definition at line 172 of file BasicBlockPass.cc.
References DataDependenceGraph::DUMP_DOT, Application::logStream(), GraphBase< GraphNode, GraphEdge >::writeToDotFile(), and DataDependenceGraph::writeToXMLFile().
Referenced by executeDDGPass(), and BBSchedulerController::executeDDGPass().
|
virtual |
Creates a DDG from the given basic block and executes a DDG pass for that.
Reimplemented in BBSchedulerController.
Definition at line 101 of file BasicBlockPass.cc.
References TTAMachine::Machine::controlUnit(), copyRMToBB(), createDDGFromBB(), SimpleResourceManager::createRM(), ddgSnapshot(), TTAMachine::ControlUnit::delaySlots(), SimpleResourceManager::disposeRM(), TTAProgram::CodeSnippet::instructionCount(), TTAProgram::BasicBlock::liveRangeData_, Application::logStream(), LiveRangeData::registersAlive(), SimpleResourceManager::smallestCycle(), and Application::verboseLevel().
Referenced by handleBasicBlock().
|
virtual |
Creates a DDG from the given basic block and executes a Loop pass for that.
Definition at line 152 of file BasicBlockPass.cc.
References assert.
Referenced by BBSchedulerController::handleBasicBlock().
|
virtual |
Handles a single basic block.
Modifies the given basic block, so if the old one is to be preserved, client should copy the original. Does not restore the BB even though handling was not successful.
basicBlock | The basic block to handle. |
machine | The target machine if any. (NullMachine::instance() if target machine is irrelevant). |
In | case handling is unsuccesful for any reason (basicBlock might still get modified). |
Reimplemented in BBSchedulerController, SequentialScheduler, and PostpassOperandSharer.
Definition at line 79 of file BasicBlockPass.cc.
References abortWithError, executeDDGPass(), and TTAProgram::CodeSnippet::instructionCount().
Referenced by ControlFlowGraphPass::executeBasicBlockPass().
|
private |
Definition at line 100 of file BasicBlockPass.hh.
Referenced by ddgBuilder().