OpenASIP
2.0
|
#include <ControlFlowEdge.hh>
Public Types | |
enum | CFGEdgePredicate { CFLOW_EDGE_NORMAL, CFLOW_EDGE_TRUE, CFLOW_EDGE_FALSE, CFLOW_EDGE_LOOP_BREAK, CFLOW_EDGE_FAKE } |
enum | CFGEdgeType { CFLOW_EDGE_JUMP, CFLOW_EDGE_CALL, CFLOW_EDGE_FALLTHROUGH } |
Public Member Functions | |
ControlFlowEdge (CFGEdgePredicate edgePredicate=CFLOW_EDGE_NORMAL, CFGEdgeType edgeType=CFLOW_EDGE_JUMP) | |
virtual | ~ControlFlowEdge () |
bool | isControlFlowEdge () const |
bool | isNormalEdge () const |
bool | isTrueEdge () const |
bool | isFalseEdge () const |
bool | isCallPassEdge () const |
bool | isJumpEdge () const |
bool | isFallThroughEdge () const |
bool | isLoopBreakEdge () const |
bool | isBackEdge () const |
TCEString | toString () const |
void | setPredicate (CFGEdgePredicate pred) |
CFGEdgePredicate | edgePredicate () const |
CFGEdgeType | edgeType () |
void | setBackEdge () |
Add property to edge to mark is as back edge - loop edge DO NOT USE unless you know what you are doing!!! More... | |
Public Member Functions inherited from GraphEdge | |
GraphEdge () | |
GraphEdge (const GraphEdge &edge) | |
virtual GraphEdge * | clone () const |
virtual | ~GraphEdge () |
virtual int | edgeID () const |
virtual TCEString | dotString () const |
int | weight () const |
void | setWeight (int w) |
Static Public Member Functions | |
static ControlFlowEdge::CFGEdgePredicate | edgePredicateFromMove (const TTAProgram::Move &move) |
Private Attributes | |
CFGEdgePredicate | edgePredicate_ |
CFGEdgeType | edgeType_ |
bool | backEdge_ |
Edge of the control flow graph (control flow edge). Each edge implies a possible change of execution flow from the source basic block to the target basic block.
Definition at line 50 of file ControlFlowEdge.hh.
Enumerator | |
---|---|
CFLOW_EDGE_NORMAL | |
CFLOW_EDGE_TRUE | |
CFLOW_EDGE_FALSE | |
CFLOW_EDGE_LOOP_BREAK | |
CFLOW_EDGE_FAKE |
Definition at line 52 of file ControlFlowEdge.hh.
Enumerator | |
---|---|
CFLOW_EDGE_JUMP | |
CFLOW_EDGE_CALL | |
CFLOW_EDGE_FALLTHROUGH |
Definition at line 59 of file ControlFlowEdge.hh.
ControlFlowEdge::ControlFlowEdge | ( | CFGEdgePredicate | edgePredicate = CFLOW_EDGE_NORMAL , |
CFGEdgeType | edgeType = CFLOW_EDGE_JUMP |
||
) |
Constructor creates Control Flow Edge of given type
edgePredicate | The truth value of edge (or normal) |
edgeType | Define if edge represents jump, if false the it is call |
Definition at line 47 of file ControlFlowEdge.cc.
|
virtual |
|
inline |
Definition at line 83 of file ControlFlowEdge.hh.
References edgePredicate_.
Referenced by ControlFlowGraph::copyToProcedure(), SimpleIfConverter::detectDiamond(), ControlFlowGraph::findJumpAddress(), LoopPrologAndEpilogBuilder::moveJumpDestination(), ControlFlowGraph::optimizeBBOrdering(), and CopyingDelaySlotFiller::updateFTBBAndCfg().
|
static |
Creates an edge predicate based on the guard of a move
Definition at line 187 of file ControlFlowEdge.cc.
References CFLOW_EDGE_FALSE, CFLOW_EDGE_NORMAL, CFLOW_EDGE_TRUE, TTAProgram::Move::destination(), TTAProgram::Move::guard(), TTAProgram::Terminal::hintOperation(), NullOperation::instance(), TTAProgram::MoveGuard::isInverted(), TTAProgram::Move::isTriggering(), TTAProgram::Move::isUnconditional(), Operation::name(), and TTAProgram::Terminal::operation().
Referenced by ControlFlowGraph::findJumpAddress().
|
inline |
Definition at line 84 of file ControlFlowEdge.hh.
References edgeType_.
Referenced by SimpleIfConverter::detectDiamond(), and CopyingDelaySlotFiller::updateFTBBAndCfg().
|
virtual |
Returns true if edge is loop back edge
Reimplemented from GraphEdge.
Definition at line 179 of file ControlFlowEdge.cc.
References backEdge_.
Referenced by CopyingDelaySlotFiller::collectMoves(), SimpleIfConverter::detectDiamond(), SimpleIfConverter::detectTriangleViaFt(), SimpleIfConverter::detectTriangleViaJump(), CopyingDelaySlotFiller::fillDelaySlots(), ControlFlowGraph::isSingleBBLoop(), ControlFlowGraph::optimizeBBOrdering(), toString(), and SimpleIfConverter::updateCfg().
bool ControlFlowEdge::isCallPassEdge | ( | ) | const |
Returns true if edge represents control flow over the call in code.
Definition at line 138 of file ControlFlowEdge.cc.
References CFLOW_EDGE_CALL, and edgeType_.
Referenced by CopyingDelaySlotFiller::bbnScheduled(), SimpleIfConverter::detectDiamond(), SimpleIfConverter::detectTriangleViaFt(), CopyingDelaySlotFiller::fillDelaySlots(), CopyingDelaySlotFiller::finishBB(), ControlFlowGraph::optimizeBBOrdering(), and toString().
bool ControlFlowEdge::isControlFlowEdge | ( | ) | const |
Returns true if object represents ControlFlowEdge.
Definition at line 99 of file ControlFlowEdge.cc.
bool ControlFlowEdge::isFallThroughEdge | ( | ) | const |
Returns true if the edge is representing fall through.
Definition at line 158 of file ControlFlowEdge.cc.
References CFLOW_EDGE_FALLTHROUGH, and edgeType_.
Referenced by LoopPrologAndEpilogBuilder::addEpilogIntoCfg(), CopyingDelaySlotFiller::fillDelaySlots(), Peel2BBLoops::testIf2BBLoop(), and toString().
bool ControlFlowEdge::isFalseEdge | ( | ) | const |
Returns true if edge represents conditional control flow that is taken if condition evaluates to false.
Definition at line 129 of file ControlFlowEdge.cc.
References CFLOW_EDGE_FALSE, and edgePredicate_.
Referenced by PreOptimizer::cfgAllowsJumpReversal(), ControlFlowGraph::reverseGuardOnOutEdges(), and toString().
bool ControlFlowEdge::isJumpEdge | ( | ) | const |
Returns true if the edge is representing jump.
Definition at line 148 of file ControlFlowEdge.cc.
References CFLOW_EDGE_JUMP, and edgeType_.
Referenced by LoopPrologAndEpilogBuilder::addPrologIntoCfg(), CopyingDelaySlotFiller::areAllJumpPredsFilled(), CopyingDelaySlotFiller::areAllJumpPredsScheduled(), ControlFlowGraph::incomingFTEdge(), ControlFlowGraph::incomingJumpEdges(), ControlFlowGraph::isSingleBBLoop(), ControlFlowGraph::jumpSuccessor(), and toString().
bool ControlFlowEdge::isLoopBreakEdge | ( | ) | const |
Returns true if edge was added to break infinite loop for control dependence computation.
Definition at line 169 of file ControlFlowEdge.cc.
References CFLOW_EDGE_LOOP_BREAK, and edgePredicate_.
Referenced by toString().
bool ControlFlowEdge::isNormalEdge | ( | ) | const |
Returns true if the edge is representing unconditional jump
Definition at line 108 of file ControlFlowEdge.cc.
References CFLOW_EDGE_NORMAL, and edgePredicate_.
Referenced by ControlFlowGraph::hasMultipleUnconditionalSuccessors(), ControlFlowGraph::mergeNodes(), and toString().
bool ControlFlowEdge::isTrueEdge | ( | ) | const |
Returns true if edge represents conditional control flow that is taken if condition evaluates to true.
Definition at line 119 of file ControlFlowEdge.cc.
References CFLOW_EDGE_TRUE, and edgePredicate_.
Referenced by PreOptimizer::cfgAllowsJumpReversal(), ControlFlowGraph::reverseGuardOnOutEdges(), SimpleIfConverter::successors(), and toString().
|
inline |
Add property to edge to mark is as back edge - loop edge DO NOT USE unless you know what you are doing!!!
Definition at line 88 of file ControlFlowEdge.hh.
References backEdge_.
Referenced by SimpleIfConverter::updateCfg().
|
inline |
Definition at line 81 of file ControlFlowEdge.hh.
References edgePredicate_.
Referenced by ControlFlowGraph::mergeNodes(), and ControlFlowGraph::reverseGuardOnOutEdges().
|
virtual |
Returns type as a string. Helper for graph output to dot file.
Reimplemented from GraphEdge.
Definition at line 64 of file ControlFlowEdge.cc.
References isBackEdge(), isCallPassEdge(), isFallThroughEdge(), isFalseEdge(), isJumpEdge(), isLoopBreakEdge(), isNormalEdge(), and isTrueEdge().
Referenced by ControlFlowGraph::reverseGuardOnOutEdges().
|
private |
Definition at line 96 of file ControlFlowEdge.hh.
Referenced by isBackEdge(), and setBackEdge().
|
private |
Definition at line 94 of file ControlFlowEdge.hh.
Referenced by edgePredicate(), isFalseEdge(), isLoopBreakEdge(), isNormalEdge(), isTrueEdge(), and setPredicate().
|
private |
Definition at line 95 of file ControlFlowEdge.hh.
Referenced by edgeType(), isCallPassEdge(), isFallThroughEdge(), and isJumpEdge().