OpenASIP
2.0
|
#include <LoopPrologAndEpilogBuilder.hh>
Public Member Functions | |
LoopPrologAndEpilogBuilder () | |
virtual | ~LoopPrologAndEpilogBuilder () |
virtual int | build (DataDependenceGraph &ddg, SimpleResourceManager &rm, ControlFlowGraph &cfg, BasicBlockNode &loopBBN, int endCycle=-1, bool createEpilog=true) |
BasicBlockNode * | addPrologFromRM (SimpleResourceManager &prologRM, SimpleResourceManager &loopRM, ControlFlowGraph &cfg, BasicBlockNode &loopBBN) |
BasicBlockNode * | addEpilogFromRM (SimpleResourceManager &prologEpilogRM, int ii, ControlFlowGraph &cfg, BasicBlockNode &loopBBN) |
Private Member Functions | |
void | moveJumpDestination (TTAProgram::InstructionReferenceManager &irm, BasicBlockNode &tail, BasicBlockNode &dst, ControlFlowEdge &jumpEdge) |
void | addPrologIntoCfg (ControlFlowGraph &cfg, BasicBlockNode &prologBBN, BasicBlockNode &loopBBN) |
void | addEpilogIntoCfg (ControlFlowGraph &cfg, BasicBlockNode &epilogBBN, BasicBlockNode &loopBBN) |
bool | optimizeProlog (TTAProgram::BasicBlock &prolog) |
bool | optimizeEpilog (TTAProgram::BasicBlock &epilog) |
Classes that implement this interface are able to software bypass moves.
Definition at line 54 of file LoopPrologAndEpilogBuilder.hh.
LoopPrologAndEpilogBuilder::LoopPrologAndEpilogBuilder | ( | ) |
Definition at line 56 of file LoopPrologAndEpilogBuilder.cc.
|
virtual |
Definition at line 59 of file LoopPrologAndEpilogBuilder.cc.
BasicBlockNode * LoopPrologAndEpilogBuilder::addEpilogFromRM | ( | SimpleResourceManager & | prologEpilogRM, |
int | ii, | ||
ControlFlowGraph & | cfg, | ||
BasicBlockNode & | loopBBN | ||
) |
Definition at line 448 of file LoopPrologAndEpilogBuilder.cc.
References TTAProgram::CodeSnippet::add(), addEpilogIntoCfg(), TTAProgram::CodeSnippet::disassembly(), SimpleResourceManager::instruction(), SimpleResourceManager::largestCycle(), Application::logStream(), SimpleResourceManager::loseInstructionOwnership(), optimizeEpilog(), BF2Scheduler::PROLOG_CYCLE_BIAS, BasicBlockNode::setScheduled(), BasicBlockNode::toString(), and Application::verboseLevel().
|
private |
Adds an epilog into control flow graph.
Creates the node and fixed edges.
cfg | cfg where to add the epilog |
prologBB | bb which contains the epilog |
loopBBN | node of cfg which contains the loop |
Definition at line 166 of file LoopPrologAndEpilogBuilder.cc.
References BoostGraph< GraphNode, GraphEdge >::addNode(), assert, ControlFlowEdge::CFLOW_EDGE_FALLTHROUGH, ControlFlowEdge::CFLOW_EDGE_NORMAL, BoostGraph< GraphNode, GraphEdge >::connectNodes(), BoostGraph< GraphNode, GraphEdge >::headNode(), ControlFlowEdge::isFallThroughEdge(), BoostGraph< GraphNode, GraphEdge >::moveInEdge(), BoostGraph< GraphNode, GraphEdge >::outDegree(), and BoostGraph< GraphNode, GraphEdge >::outEdge().
Referenced by addEpilogFromRM(), and build().
BasicBlockNode * LoopPrologAndEpilogBuilder::addPrologFromRM | ( | SimpleResourceManager & | prologRM, |
SimpleResourceManager & | loopRM, | ||
ControlFlowGraph & | cfg, | ||
BasicBlockNode & | loopBBN | ||
) |
Stupid immediates still have to be copied from the main loop :(
Definition at line 408 of file LoopPrologAndEpilogBuilder.cc.
References addPrologIntoCfg(), BasicBlockPass::copyRMToBB(), TTAProgram::CodeSnippet::disassembly(), SimpleResourceManager::initiationInterval(), ControlFlowGraph::instructionReferenceManager(), Application::logStream(), ResourceManager::machine(), optimizeProlog(), BF2Scheduler::PROLOG_CYCLE_BIAS, BasicBlockNode::setScheduled(), SimpleResourceManager::smallestCycle(), BasicBlockNode::toString(), and Application::verboseLevel().
|
private |
Adds a prolog into control flow graph.
Creates the node and fixed edges and instruction references.
cfg | cfg where to add the prolog |
prologBB | bb which contains the prolog |
loopBBN | node of cfg which contains the loop |
Definition at line 120 of file LoopPrologAndEpilogBuilder.cc.
References BoostGraph< GraphNode, GraphEdge >::addNode(), ControlFlowEdge::CFLOW_EDGE_FALLTHROUGH, ControlFlowEdge::CFLOW_EDGE_NORMAL, BoostGraph< GraphNode, GraphEdge >::connectNodes(), BoostGraph< GraphNode, GraphEdge >::inDegree(), BoostGraph< GraphNode, GraphEdge >::inEdge(), ControlFlowGraph::instructionReferenceManager(), ControlFlowEdge::isJumpEdge(), BoostGraph< GraphNode, GraphEdge >::moveInEdge(), moveJumpDestination(), BoostGraph< GraphNode, GraphEdge >::tailNode(), and Application::verboseLevel().
Referenced by addPrologFromRM(), and build().
|
virtual |
Definition at line 192 of file LoopPrologAndEpilogBuilder.cc.
References TTAProgram::CodeSnippet::add(), addEpilogIntoCfg(), TTAProgram::Instruction::addImmediate(), TTAProgram::Instruction::addMove(), DataDependenceGraph::addNode(), addPrologIntoCfg(), assert, TTAProgram::Immediate::copy(), MoveNode::copy(), DataDependenceGraph::copyExternalInEdges(), DataDependenceGraph::copyExternalOutEdges(), MoveNode::cycle(), TTAProgram::CodeSnippet::disassembly(), TTAProgram::Instruction::immediate(), TTAProgram::Instruction::immediateCount(), SimpleResourceManager::initiationInterval(), SimpleResourceManager::instruction(), TTAProgram::CodeSnippet::instructionAtIndex(), TTAProgram::Move::isControlFlowMove(), DataDependenceGraph::largestCycle(), Application::logStream(), MoveNode::move(), MoveNode::movePtr(), BoostGraph< GraphNode, GraphEdge >::node(), BoostGraph< GraphNode, GraphEdge >::nodeCount(), optimizeEpilog(), optimizeProlog(), BasicBlockNode::originalStartAddress(), BoostGraph< GraphNode, GraphEdge >::rootGraph(), MoveNode::setCycle(), TTAProgram::Move::setGuard(), SimpleResourceManager::smallestCycle(), MoveNode::toString(), and Application::verboseLevel().
|
private |
Definition at line 63 of file LoopPrologAndEpilogBuilder.cc.
References abortWithError, BasicBlockNode::basicBlock(), TTAProgram::InstructionReferenceManager::createReference(), ControlFlowEdge::edgePredicate(), CopyingDelaySlotFiller::findJump(), CopyingDelaySlotFiller::findJumpImmediate(), TTAProgram::CodeSnippet::instructionAtIndex(), TTAProgram::Terminal::isInstructionAddress(), TTAProgram::Terminal::setInstructionReference(), TTAProgram::BasicBlock::skippedFirstInstructions(), and TTAProgram::Move::source().
Referenced by addPrologIntoCfg().
|
private |
Definition at line 575 of file LoopPrologAndEpilogBuilder.cc.
References assert, TTAProgram::CodeSnippet::instructionAtIndex(), TTAProgram::CodeSnippet::instructionCount(), TTAProgram::Instruction::moveCount(), and TTAProgram::CodeSnippet::remove().
Referenced by addEpilogFromRM(), and build().
|
private |
Definition at line 492 of file LoopPrologAndEpilogBuilder.cc.
References TTAProgram::Immediate::destination(), TTAProgram::Instruction::immediate(), TTAProgram::Instruction::immediateCount(), TTAProgram::Terminal::immediateUnit(), TTAProgram::Terminal::index(), TTAProgram::CodeSnippet::instructionAtIndex(), TTAProgram::CodeSnippet::instructionCount(), TTAProgram::Terminal::isImmediateRegister(), TTAMachine::ImmediateUnit::latency(), TTAProgram::Instruction::move(), TTAProgram::Instruction::moveCount(), TTAProgram::CodeSnippet::remove(), TTAProgram::Instruction::removeImmediate(), and TTAProgram::Move::source().
Referenced by addPrologFromRM(), and build().