next up previous
Next: Algorithm Up: Dataflow Analysis Framework Previous: Dataflow Analysis Framework

Overview

The C-Breeze compiler includes an iterative dataflow framework similar to the one described in Compilers: Principles, Techniques, and Tools (the Dragon Book). Note that this dataflow framework assumes that the code has not been dismantled. A dataflow analysis problem consists of the following components:

1.
A set V of flow values to be propagated throughout the program. Members of V represent the state of the analysis at a particular point in the program (e.g., ``the set of live variables at this point''). Members of V include in, out, gen, and kill.

2.
A set F of transfer functions from V to V. These functions embody the effects of computations on the flow values.

3.
A binary meet operation on flow values that represents the confluence of information. This is used to reconcile two flow values that have taken different possible paths through the program.

4.
A direction of propagation: forward or backward.

The C-Breeze framework provides most of the necessary algorithms--your job is to provide the flow values, the transfer functions, and the meet operator.

To define the dataflow problem, create a subclass of each of the two dataflow classes, FlowVal and FlowProblem. The abstract class FlowVal defines the flow values and the meet operation. The FlowProblem class provides the entry point and holds the transfer functions. Both classes are defined in dataflow.h.


next up previous
Next: Algorithm Up: Dataflow Analysis Framework Previous: Dataflow Analysis Framework
Calvin Lin
2002-01-31