Data Dependences: CS 524 - High-Performance Computing
Data Dependences: CS 524 - High-Performance Computing
Data Dependences: CS 524 - High-Performance Computing
CS 524 – High-Performance
Computing
Motivating Example: Superscalar Execution
S1
S2
S3 S4
CS 524 (Au 2004/05)- Asim Karim @ LUMS 3
Types of Dependences (1)
Three types are usually defined:
Flow-dependence occurs when a variable which is assigned a
value in one statement say S1 is used in another statement,
say S2 later. Written as S1 δf S2
Anti-dependence occurs when a variable which is used in one
statement say S1 is assigned a value in another statement, say
S2, later. Written as S1 δa S2
Output dependence occurs when a variable which is assigned
a value in one statement say S1 is later reassigned in another
statement say S2. Written as S1 δo S2
do i = 3, 50
S1: A(i+1) = ...
S2: ... = A(i-2) ...
end do
S1
S2
do i = 1, 50
S1: A(i-1) = ...
S2: ... = A(i+1) ...
end do
S1
S2
(-+)
i i