Bill Currie
8c5a2b3d11
Implement depth-first searching for flow graphs.
...
This fixes the bogusly irreducible graphs.
2012-11-15 13:44:07 +09:00
Bill Currie
53622dbb99
Perform graph reduction on the function's flow graph.
...
The reduction is performed itteratively until the graph is irreducible, but
such that each reduction wraps the previous graph. Unfortunately, due
depth-first searching not being implemented, graphs that should be reduced
(ie, those with natural loops).
2012-11-15 13:44:07 +09:00
Bill Currie
2da038ce0f
Bring back dot_flow.c.
...
However, it produces simplified flow graphs (ie, just nodes and edges, no
statements, though later on data flow information will be added).
2012-11-15 13:44:07 +09:00
Bill Currie
c483770121
Rework flow.c with the aim of graph reduction.
...
Much of the data recently added to sblock_t has been moved to flownode_t.
No graph reduction is carried out yet, but the initial (innermost level)
graph has been built.
2012-11-15 13:44:07 +09:00
Bill Currie
da446fd343
Detect natural loops.
...
Non-nested loops that have the same head-node are merged into one loop.
However, loop nesting is not currently detected (next step).
2012-11-15 13:44:07 +09:00
Bill Currie
1fead50f4e
Calculate the dominators of each node in the flow graph.
...
The dominators are represented by sets using the node numbers.
2012-11-15 13:44:07 +09:00
Bill Currie
7853bf1859
Calculate a node's successors and predecessors.
...
The dot graphs are a little odd (arrow heads on the wrong end of the
predecessor edges), but things seem to be correct.
2012-11-15 13:44:06 +09:00
Bill Currie
739ebc522c
Begin working on flow analysis.
...
For now, variable and flow graph node maps are built.
2012-11-15 13:44:06 +09:00