






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An in-depth exploration of control flow analysis, specifically focusing on algorithms and interval analysis. Topics covered include finding dominators, loop detection, extended basic blocks, pre-headers, reducible flow graphs, and node splitting. The document also discusses the advantages and disadvantages of different approaches to control flow analysis.
Typology: Slides
1 / 10
This page cannot be seen from the preview
Don't miss anything!







D(n0) := {n0}; for n in N-{n0} do D(n) := N; while changes to any D(n) occur do for n in N-{n0} do D(n) := {n} n D(p);
Search for a back-edge such that a → b is an edge and b dom a. Given a back edge a → b Find set of nodes that can reach node a without going through node b And node b These nodes form a natural loop with b as header. Given back edge a → b natural loop is a sub graph which contains a, b and all the nodes which can reach a without passing through b
Maximal sequence of instructions begining with a header and no other join nodes Single entry multiple exits block
Depth first traversal contains (i) all the nodes and (ii) edges which make depth first order. This is called depth first spanning tree. Forward edges: from a node to descendent Back edges: go from node to ancestor Cross edges: connects nodes such that neither is an ancestor in dfs
Many optimizations require code movement from inside a loop to just before it. Pre-header is a new empty block just before header. All edges from outside to header go to pre-header A new edge goes from pre-header to header
Two loops with different headers are either disjoint or nested Two loops with the same header Not clear if they are nested Or are one loop Can not be decided without looking at the source code
In a reducible graph All the loops are natural loops There are no jumps in the middle of a loop Improper regions are multiple entry strongly connected regions
Programming languages do not allow irreducible flow graphs Fortran with loops of if and gotos construct irreducible flow graphs Most of the optimizations do not work for irreducible flow graphs Node splitting is a possible solution
Transformation used for converting non-reducible flow graphs to reducible flow graphs. If there is a node n with k predecessors:
Split n into k nodes generating nodes n1, n2, ..., nk The ith predecessor of n becomes the predecessors of ni All the successors of n become successors of all of the ni’ s
Divides flow graph into various regions Consolidate each region into a (abstract) node Resulting flow graph is an abstract flow graph Result of transformations produce control tree Root represents the original graph Leaf of control tree are basic blocks Internal nodes are abstract nodes Edges represent relationship between abstract nodes
Each interval has a header node that dominates all the nodes in the interval. Given a flow graph with initial node n0, the interval with header n is denoted by I(n) and is defined as: N is in I(n) If all the predecessors of a node m are in I(n) then m is in I(n) No other node is in I(n)
file:///D|/...ry,%20Dr.%20Sanjeev%20K%20Aggrwal%20&%20Dr.%20Rajat%20Moona/Multi-core_Architecture/lecture%2027/27_10.htm[6/14/2012 12:08:59 PM]
If the limit flow graph is a single node then the graph is reducible.
The result of applying a sequence of such transformations produces a control tree. It is defined as follows:
The root is sn abstract graph representing the original flowgraph The leaves are individual basic blocks The internal nodes are abstract nodes representing regions of the flowgraph The edges of the tree represent the relationship between each abstract node and the regions that are its descendants