harpoon.Analysis.DataFlow
Class Solver

java.lang.Object
  extended by harpoon.Analysis.DataFlow.Solver

public class Solver
extends Object

Solver contains static methods to find the fixed point of a set of data-flow equations. It is a generalization of the QuadSolver and InstrSolver that is intended for general usage on any Intermediate Representation that is amicable to data-flow analysis.

Version:
$Id: Solver.java,v 1.3 2004/02/08 01:51:05 cananian Exp $
Author:
Felix S. Klock II <pnkfelix@mit.edu>

Method Summary
static void forwardRPOSolve(BasicBlock root, DataFlowBasicBlockVisitor v)
           
static void worklistSolve(Iterator blocks, DataFlowBasicBlockVisitor v)
          Performs dataflow analysis on a set of BasicBlocks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

worklistSolve

public static void worklistSolve(Iterator blocks,
                                 DataFlowBasicBlockVisitor v)
Performs dataflow analysis on a set of BasicBlocks. Finds the maximum fixed point for the data-flow equations defined by v. FSK: it seems to me that the blocks are added to a stack and then popped off for visitation, which means that if you want to visit the blocks in say Reverse Postorder, then blocks must iterate over them in *Normal* Postorder. This seems viciously unintuitive... perhaps the Solver interface should be revised to offer more control over the traversal... (on the other hand, the current implementation doesn't seem to be performing that shabbily to me, so perhaps is better to leave well enough alone...)
requires:
  1. The elements of blocks are BasicBlocks.
  2. v can safely visit the elements of blocks.

modifies: v, blocks
effects: Sends v into the elements of blocks and the 'successors' of the elements of blocks (where 'successors' is defined by v's addSuccessors() method). On each visitation, performs v's transfer function on each BasicBlock in turn, tracking for when no change occurs to the 'successors', at which point analysis is complete. This method guarantees that all of the BasicBlocks. in blocks will be visited by v at least once.


forwardRPOSolve

public static void forwardRPOSolve(BasicBlock root,
                                   DataFlowBasicBlockVisitor v)