9.1 Data Flow Analysis Methods

9.2 Reaching Definitions

9.3 Available Expressions

9.4 Live Variables

9.5 Reached Uses

9.6 Very Busy Expressions

9.7 High-Level Data Flow Analysis

9.8 Interprocedural Data Flow Analysis

9.9 Summary

Web References

Exercises

EXERCISE

1. Change the following example so that the expression X + Y is available

    (a) At the end of block2

    (b) At the beginning of block 3

2. The following is the control flow graph for the example from the beginning of Chapter 7:

    For all blocks, compute

    (a) Reaching definitions

    (b) Live variables

    (c) Available expressions

    (d) Reached uses

    (e) Very busy expressions

3. There may really be more available expressions thatn the definiton for available expressions finds. Find such a case.

4. show how the procedure call P(x,x) might create aliases.

5. Using the method of Section 8.7, define equations for available expression analysis (Babich and Jazayeri, 1978a).

6. Define Gen and Kill sets for interprocedural analysis of

    (a) Live variables

    (b) Available expressions

7. The grammar of Section 8.7 fails to be an attribute grammar as defined in Chapter 6 for two reasons. What are they?

8. By using set-valued equations, extend the equations of Section 8.7 to include all the variables in a program. Perform the data flow analysis for Example 12 using these equations.

9. For Example 12:

    (a) show the step by step details of pass 1.

    (b) show the remaining passes.

10. Using Section 8.7 as a model, write the equations for

    (a) Available expressions

    (b) Reaching definitions

For each, perform the analysis on the program of Example 12.