5 questions to test your understanding
Variable x is assigned on line 5 (x = 10) and on line 8 (x = y + 2). An if-statement between lines 5 and 12 can route control through line 8 or bypass it. At line 12, the use of x is analyzed. What does its U-D chain contain?
A compiler wants to apply constant propagation to replace a use of variable x with a literal. Using U-D chains, what condition must hold?
U-D chains allow a compiler to answer data-dependence queries with targeted lookups rather than re-solving reaching-definitions equations for every optimization pass.
A use of a variable generally has exactly one definition in its U-D chain, because programs is expected to assign a variable before using it.
Why are U-D chains described as enabling 'sparse' analysis, and how do they improve on using reaching-definitions sets directly for each optimization query?