Module 16: Data Flow Analysis in Presence of Procedure Calls
  Lecture 31: Data Dependence Analysis
 


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

  1. Rename variables so that no two procedures use the same formal parameters or local identifiers
  2. If there is a procedure and an invocation , set
  3. 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