






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
The concepts of control flow analysis, specifically identifying loops and dominators in compiler construction. It covers the definitions, properties, and algorithms for finding loops and dominators, as well as the characteristics of dominator information and the dominator tree. The document also explains how to compute dominator sets and construct natural loops.
Typology: Study notes
1 / 10
This page cannot be seen from the preview
Don't miss anything!







1
Lecture 2 Control Flow Analysis 2 What is a loop? A subgraph of CFG with the following properties:
3 Property Given two loops: they are either disjoint or one is completely nested within the other. Loops {1,2,4} and {5,6} are Disjoint. Loop {5,6} is nested within loop {2,4,5,6}. Loop {5,6} is nested within loop {2,3,4,5,6}. Identifying Loops
Observation: node m donimates node n iff m dominates all predecessors of n. 8 Let D(n) = set of dominators of n Where Pred(n) is set of immediate predecessors of n in the CFG
Computing Dominator Sets 9 Initial Approximation: D(no) = {no} no is the start node. D(n) = N, for all n!=no N is set of all nodes. Iteratively Refine D(n)’s: Algorithm: Example: Computing Dom. Sets 10
Back Edges: 94, 108, 10 5
Example
13 Loop = {2,7} + {6} + {4} + {5} + {3} Stack = 7 6 4 5 3
Examples 14
L2 nested in L L1 S1,S2,S3,S L2 S2,S3,S L2 nested in L While A do S While B do S Endwhile Endwhile ?
Reducible Flow Graph
15 Reducible Flow Graph
Example 19
Depth First Ordering Back edge Forward edge