| |
Interprocedural dataflow analysis
Aliases : If two variables denote the same memory location
s1 : a := b+x
s2 : y := c
s3 : d := b+x |
is b+x available at s3?
Yes, provided x and y are not aliases
language :
- Permits recursive procedures
- May refer to both global & local definitions
- Data variables consist of globals and its own locals (no block structuring)
- Parameters by reference
- Single return node
Alias Computation
- Rename variables so that no two procedures use the same formal parameters or local identifiers
- If there is a procedure
and an invocation , set
- Take reflexive and transitive closure by adding
X ≡ Y whenever Y ≡ X
X ≡ Z whenever X ≡ Y and Y ≡ Z
Example
global g,h
zero();
local i;
g := · · ·
one(h, i); h ≡ w i ≡ x
end zero;
one(w, x)
x := · · ·
two(w, w); w ≡ y w ≡ z
two(g, x); g ≡ y x ≡ z
end one;
two(y, z)
local k;
h := · · ·
one(k, y) k ≡ w y ≡ x
end two;
Therefore, h ≡ w ≡ y ≡ z ≡ k ≡ x ≡ i ≡ g |
|