1 CS553 Lecture Static Single Assignment Form 3 Data Dependence Definition – Data dependences are constraints on the order i n which statements may be executed We say statement s 2 depends on s 1 –Flow (true) dependence : s 1 writes memory that s 2 later reads (RAW) –Anti-dependence: s 1 reads memory that s 2 later writes (WAR) –Output dependences : s 1 writes memory that s 2 later writes (WAW) –Input dependences : s 1 reads memory that s 2 later reads (RAR) True dependences – Flow dependences represent actual flow of data False dependences – Anti- and output dependences reflect reuse of memory , not actual data flow; can often be eliminated CS553 Lecture Static Single Assignment Form 4 Example s 1 a = b; s 2 b = c + d; s 3 e = a + d; s 4 b = 3; s 5 f = b * 2; flow anti outputinputCS553 Lecture Static Single Assignment Form 5 Representing Data Dependences Implicitly – Using va riabl e defs and uses – Pros: simpl e – Cons: hides data dependence (analyses must find this info) Def-use chains (du chains) – Link eac h def to its us es – Pros: expli cit; theref ore fast – Cons: must be computed and updated, space consuming Alternate representations –e.g., Static single assignment form (SSA), dependence flow graphs (DFG), value dependence graphs (VDG) CS553 Lecture Static Single Assignment Form 6 DU Chains Definition – du chains li nk each def to i ts uses Example s 1 a = b; s 2 b = c + d; s 3 e = a + d; s 4 b = 3; s 5 f = b * 2; du chain