OpenASIP
2.0
|
#include <Peel2BBLoops.hh>
Classes | |
struct | BBNodes |
Public Member Functions | |
Peel2BBLoops (InterPassData &data, const TTAMachine::Machine &targetMachine) | |
void | handleControlFlowGraph (ControlFlowGraph &cfg, const TTAMachine::Machine &targetMachine) override |
virtual std::string | shortDescription () const override |
Public Member Functions inherited from ControlFlowGraphPass | |
ControlFlowGraphPass (InterPassData &data) | |
virtual | ~ControlFlowGraphPass () |
void | executeBasicBlockPass (ControlFlowGraph &cfg, const TTAMachine::Machine &targetMachine, BasicBlockPass &bbPass) |
Public Member Functions inherited from SchedulerPass | |
SchedulerPass (InterPassData &data) | |
virtual | ~SchedulerPass () |
InterPassData & | interPassData () |
virtual std::string | longDescription () const |
Private Member Functions | |
bool | negateOp (ProgramOperationPtr po) |
BBNodes | testIf2BBLoop (ControlFlowGraph &cfg, BasicBlockNode &bbn) |
void | peel2BBLoop (ControlFlowGraph &cfg, BBNodes &bbns) |
void | updateCFG (ControlFlowGraph &cfg, BBNodes &bbns) |
void | performCodeMotion (BBNodes &bbns) |
void | appendBB (const TTAProgram::BasicBlock &src, TTAProgram::BasicBlock &dest, BasicBlockNode *newJumpDest) |
Private Attributes | |
TTAProgram::CodeGenerator * | codeGenerator_ |
TTAProgram::InstructionReferenceManager * | irm_ |
const TTAMachine::Machine & | mach_ |
Definition at line 22 of file Peel2BBLoops.hh.
Peel2BBLoops::Peel2BBLoops | ( | InterPassData & | data, |
const TTAMachine::Machine & | targetMachine | ||
) |
Definition at line 31 of file Peel2BBLoops.cc.
|
private |
Definition at line 172 of file Peel2BBLoops.cc.
References TTAProgram::CodeSnippet::add(), MoveNode::addDestinationOperationPtr(), TTAProgram::Instruction::addMove(), assert, BasicBlockNode::basicBlock(), codeGenerator_, TTAProgram::Move::copy(), TTAProgram::CodeGenerator::createInverseGuard(), MoveNode::destinationOperation(), SimpleIfConverter::fixTerminalPO(), TTAProgram::CodeSnippet::instructionAtIndex(), TTAProgram::CodeSnippet::instructionCount(), TTAProgram::Instruction::move(), TTAProgram::Instruction::moveCount(), negateOp(), OperationPool::operation(), ProgramOperation::setOperation(), and MoveNode::setSourceOperationPtr().
Referenced by performCodeMotion().
|
overridevirtual |
Handles a cfg.
cfg | cfg to be optimized. |
Reimplemented from ControlFlowGraphPass.
Definition at line 101 of file Peel2BBLoops.cc.
References codeGenerator_, ControlFlowGraph::instructionReferenceManager(), irm_, BoostGraph< GraphNode, GraphEdge >::node(), BoostGraph< GraphNode, GraphEdge >::nodeCount(), peel2BBLoop(), and testIf2BBLoop().
Referenced by llvm::LLVMTCEIRBuilder::compileOptimized().
|
private |
Negates operation into operation which generates opposite predicate value.
Definition at line 267 of file Peel2BBLoops.cc.
References mach_, Operation::name(), OperationPool::operation(), and MachineInfo::supportsOperation().
Referenced by appendBB().
|
private |
Definition at line 124 of file Peel2BBLoops.cc.
References performCodeMotion(), and updateCFG().
Referenced by handleControlFlowGraph().
|
private |
Definition at line 156 of file Peel2BBLoops.cc.
References appendBB(), assert, BasicBlockNode::basicBlock(), Peel2BBLoops::BBNodes::beginLoop, Peel2BBLoops::BBNodes::endLoop, Peel2BBLoops::BBNodes::postLoop, Peel2BBLoops::BBNodes::preLoop, and SimpleIfConverter::removeJump().
Referenced by peel2BBLoop().
|
inlineoverridevirtual |
A short description of the pass, usually the optimization name, such as "basic block scheduler".
Implements SchedulerPass.
Definition at line 32 of file Peel2BBLoops.hh.
|
private |
Definition at line 37 of file Peel2BBLoops.cc.
References BoostGraph< GraphNode, GraphEdge >::headNode(), BoostGraph< GraphNode, GraphEdge >::inDegree(), BoostGraph< GraphNode, GraphEdge >::inEdge(), BoostGraph< GraphNode, GraphEdge >::inEdges(), ControlFlowEdge::isFallThroughEdge(), BasicBlockNode::isNormalBB(), BoostGraph< GraphNode, GraphEdge >::outDegree(), BoostGraph< GraphNode, GraphEdge >::outEdge(), BoostGraph< GraphNode, GraphEdge >::outEdges(), and BoostGraph< GraphNode, GraphEdge >::tailNode().
Referenced by handleControlFlowGraph().
|
private |
Definition at line 130 of file Peel2BBLoops.cc.
References Peel2BBLoops::BBNodes::beginLoop, ControlFlowEdge::CFLOW_EDGE_FALLTHROUGH, ControlFlowEdge::CFLOW_EDGE_JUMP, BoostGraph< GraphNode, GraphEdge >::connectingEdges(), BoostGraph< GraphNode, GraphEdge >::connectNodes(), ControlFlowGraph::deleteNodeAndRefs(), BoostGraph< GraphNode, GraphEdge >::disconnectNodes(), Peel2BBLoops::BBNodes::endLoop, BoostGraph< GraphNode, GraphEdge >::moveOutEdge(), Peel2BBLoops::BBNodes::postLoop, and Peel2BBLoops::BBNodes::preLoop.
Referenced by peel2BBLoop().
|
private |
Definition at line 62 of file Peel2BBLoops.hh.
Referenced by appendBB(), and handleControlFlowGraph().
|
private |
Definition at line 63 of file Peel2BBLoops.hh.
Referenced by handleControlFlowGraph().
|
private |
Definition at line 64 of file Peel2BBLoops.hh.
Referenced by negateOp().