Main Page Modules Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages
loopTree Class Reference#include <loops.h>
List of all members.
|
Public Types |
enum | EdgeKind { TreeEdge,
BackEdge,
ForwardEdge,
CrossEdge
} |
Public Member Functions |
| loopTree (procNode *procedure) |
| Create a loop tree.
|
| ~loopTree () |
| Delete a loop tree.
|
procNode * | procedure () const |
| Procedure.
|
loopTreeNode * | topLoop () const |
| Top loop object.
|
edge_map & | backedges () |
| Accessors.
|
edge_map & | treeedges () |
loopTreeNode * | whichLoop (basicblockNode *block) |
| Which loop.
|
loopTreeNode * | loopAncestor (loopTreeNode *loop) |
| Find a loop ancestor.
|
EdgeKind | classifyEdge (basicblockNode *source, basicblockNode *target) |
| Edge classification.
|
void | report () |
| Report.
|
Private Member Functions |
void | findLoop (basicblockNode *candidate, basicblock_set_map &generators_map) |
| Decide if a block is a loop header.
|
void | findBody (basicblockNode *head, basicblock_set &generators, loopTreeNode::LoopKind kind) |
| Determine the body of a loop.
|
basicblockNode * | commonDominator (basicblockNode *first, basicblockNode *second) |
| Find a common dominator for two blocks.
|
void | classifyEdges (basicblock_list &post_order) |
| Classify edges.
|
void | depthFirstSearch (basicblockNode *cur, basicblock_list &post_order, int &pre_order_number, int &post_order_number) |
| Depth-first search.
|
void | setDepths (loopTreeNode *cur, int depth) |
| Set the depth on each loop nest.
|
void | report (loopTreeNode *cur, int level) |
| Report (tree recursion).
|
Private Attributes |
procNode * | _procedure |
| The procedure.
|
loopTreeNode * | _top |
| The loop tree.
|
loop_list | _loops |
| A list of the loops.
|
blockloop_map | _containedIn |
| Mapping from basic blocks to loops.
|
edge_map | _backEdges |
| List of back edges.
|
edge_map | _forwardEdges |
| List of forward edges.
|
edge_map | _treeEdges |
| List of tree edges.
|
edge_map | _crossEdges |
| List of cross edges.
|
basicblock_int_map | _preOrder |
| Depth-first pre-order of the nodes.
|
basicblock_int_map | _rpostOrder |
| Depth-first reverse-post-order of the nodes.
|
Member Enumeration Documentation
Constructor & Destructor Documentation
loopTree::loopTree |
( |
procNode * |
procedure |
) |
|
|
|
Create a loop tree.
This constructor is responsible for creating the loop tree. Dominators(procedure, boolean) must be run before this phase will work. Since there is no way to run this from the command line, you MUST run the dominators pass yourself.
Definition at line 106 of file loops.cc.
References basicblock_list, basicblock_list_p, basicblock_set, basicblock_set_map, classifyEdges(), procNode::entry(), procNode::exit(), findBody(), findLoop(), procedure(), setDepths(), and loopTreeNode::Top. |
|
Delete a loop tree.
This destructor is reponsible for deleting all of the loop tree nodes as well.
Definition at line 157 of file loops.cc.
References _loops, and loop_list_p. |
Member Function Documentation
edge_map& loopTree::backedges |
( |
|
) |
[inline] |
|
|
Edge classification.
Given a particular source and target in the control-flow graph, indicate which kind of edge it is: tree, forward, backward, or cross.
Definition at line 548 of file loops.cc.
References _backEdges, _crossEdges, _forwardEdges, BackEdge, basicblock_set, CrossEdge, edge_map_p, EdgeKind, ForwardEdge, and TreeEdge.
Referenced by procedureInfo::reverse_post_order(). |
|
Classify edges.
Perform a depth-first search of the control-flow graph, building pre-order and reverse-post-order orderings of the nodes, as well as classifying th edges. Also, return a list with the post-order traversal.
Definition at line 409 of file loops.cc.
References _backEdges, _crossEdges, _forwardEdges, _preOrder, _procedure, _rpostOrder, procNode::body(), depthFirstSearch(), procNode::entry(), stmt_list, stmt_list_p, and blockNode::stmts().
Referenced by loopTree(). |
void loopTree::depthFirstSearch |
( |
basicblockNode * |
cur, |
|
|
basicblock_list & |
post_order, |
|
|
int & |
pre_order_number, |
|
|
int & |
post_order_number |
|
) |
[private] |
|
|
Depth-first search.
Definition at line 443 of file loops.cc.
References _backEdges, _crossEdges, _forwardEdges, _preOrder, _rpostOrder, _treeEdges, BackEdge, basicblock_list_p, stmtNode::comment(), CrossEdge, EdgeKind, ForwardEdge, basicblockNode::succs(), and TreeEdge.
Referenced by classifyEdges(). |
|
Determine the body of a loop.
Definition at line 243 of file loops.cc.
References _containedIn, _loops, _preOrder, _top, basicblock_list, basicblock_list_p, basicblock_set, basicblock_set_p, stmtNode::comment(), loopAncestor(), loopTreeNode::MultipleEntry, loopTreeNode::parentLoop(), basicblockNode::preds(), loopTreeNode::SingleEntry, loopTreeNode::Top, and whichLoop().
Referenced by findLoop(), and loopTree(). |
procNode* loopTree::procedure |
( |
|
) |
const [inline] |
|
void loopTree::report |
( |
loopTreeNode * |
cur, |
|
|
int |
level |
|
) |
[private] |
|
void loopTree::report |
( |
|
) |
|
|
void loopTree::setDepths |
( |
loopTreeNode * |
cur, |
|
|
int |
depth |
|
) |
[private] |
|
|
Top loop object.
Note that this is not really a loop; it's just used as the root of the tree
Definition at line 230 of file loops.h. |
edge_map& loopTree::treeedges |
( |
|
) |
[inline] |
|
Member Data Documentation
edge_map loopTree::_crossEdges [private]
|
|
edge_map loopTree::_forwardEdges [private]
|
|
procNode* loopTree::_procedure [private]
|
|
The documentation for this class was generated from the following files:
|