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 () |
loop_list & | loops () |
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
|
- Enumeration values:
-
TreeEdge |
|
BackEdge |
|
ForwardEdge |
|
CrossEdge |
|
Definition at line 148 of file loops.h. |
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. |
|
Delete a loop tree.
This destructor is reponsible for deleting all of the loop tree nodes as well. |
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. |
|
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. |
|
Find a common dominator for two blocks.
|
void loopTree::depthFirstSearch |
( |
basicblockNode * |
cur, |
|
|
basicblock_list & |
post_order, |
|
|
int & |
pre_order_number, |
|
|
int & |
post_order_number |
|
) |
[private] |
|
|
Determine the body of a loop.
|
|
Decide if a block is a loop header.
|
procNode* loopTree::procedure |
( |
|
) |
const [inline] |
|
void loopTree::report |
( |
loopTreeNode * |
cur, |
|
|
int |
level |
|
) |
[private] |
|
void loopTree::report |
( |
|
) |
|
|
void loopTree::setDepths |
( |
loopTreeNode * |
cur, |
|
|
int |
depth |
|
) |
[private] |
|
|
Set the depth on each loop nest.
|
|
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.
References _top. |
edge_map& loopTree::treeedges |
( |
|
) |
[inline] |
|
|
Which loop.
Determine which loop a particular basic block belongs to. |
Member Data Documentation
|
List of back edges.
Back edges are stored according to the *target* of the back-edge, not the source. This is because the algorithm needs to easily find all the back-edges that impinge on a candidate node.
Definition at line 174 of file loops.h.
Referenced by backedges(). |
|
Mapping from basic blocks to loops.
Definition at line 166 of file loops.h. |
|
List of cross edges.
Stored according to the source of the edge
Definition at line 192 of file loops.h. |
|
List of forward edges.
Stored according to the source of the edge
Definition at line 180 of file loops.h. |
|
Depth-first pre-order of the nodes.
Definition at line 196 of file loops.h. |
|
Depth-first reverse-post-order of the nodes.
Definition at line 200 of file loops.h. |
|
List of tree edges.
Stored according to the source of the edge
Definition at line 186 of file loops.h.
Referenced by treeedges(). |
The documentation for this class was generated from the following file:
|