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


Approaches to data dependence relations:

  • Address Based: Dependences which use the same address
  • Value Based: Dependences which use the same value
Consider
A = 0
B = A
A = B + 1
C = A

Address-based approach Value-Based Approach
There is a flow dependence
between S1 and S4
S1 → S4
because S4 uses A
In (4) value of A used is
defined in (3) and not in (1)
thus, there is no data dependence

Value based dependence is a subset of Address based dependence.

For Address-based dependence:

then ?

This is written as and is used for cache optimizations

Basic Block Dependence

  • Construct dependence graph for the instructions
  • I1 and I2 may have flow, anti or output dependence
  • Can not determine whether I1 can be moved beyond I2
  • Suppose an instruction reads from [r11](4) and the next instruction writes to [r12+12](4)
  • Unless we know r11 and r12+12 point to different locations assume a flow dependence
  • I1 is a predecessor of I2 if I2 must not execute before some cycles of I1
  • Type of dependency is not important