Class SSA


  • public class SSA
    extends java.lang.Object
    Compute the SSA form of the control flow graph and build FUD chains.

    The SSA algorithm is from:

         R. Cytron, J. Ferrante J, B. K. Rosen, M. N. Wegman, and F. K. Zadeck,
         "Efficiently Computing Static Single Assignment Form and the Control
         Dependence Graph", TOPLAS, 13(4): 451-490, October 1991.
     

    I made modifications to the algorithm to compute FUD chains and to run the algorithm separately for each variable similar to the SSAPRE algorithm. Making a separate pass for each variable allows variables to be added incrementally.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static boolean DEBUG  
    • Constructor Summary

      Constructors 
      Constructor Description
      SSA()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void transform​(FlowGraph cfg)
      Transforms a control flow graph into Single Static Assignment (SSA) form.
      static void transform​(FlowGraph cfg, SSAConstructionInfo info)
      Performs the actions necessary to convert a CFG into SSA form with respect to one variable.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEBUG

        public static boolean DEBUG
    • Constructor Detail

      • SSA

        public SSA()
    • Method Detail

      • transform

        public static void transform​(FlowGraph cfg)
        Transforms a control flow graph into Single Static Assignment (SSA) form. First, the CFG is traversed and a list of all variables (both local and stack) eligible for SSA renaming is compiled. Variables are represented by instances of SSAConstructionInfo. Each of these variables is then transformed.
        See Also:
        transform(FlowGraph), SSAConstructionInfo
      • transform

        public static void transform​(FlowGraph cfg,
                                     SSAConstructionInfo info)
        Performs the actions necessary to convert a CFG into SSA form with respect to one variable. The variable's information is stored in the SSAConstructionInfo.