Class Liveness

java.lang.Object
EDU.purdue.cs.bloat.codegen.Liveness

public class Liveness extends Object
Liveness represents the interference graph of the local variables contained in a control flow graph. When the liveness of two variables overlap each other, the two variables are said to interfere with each other. The interference graph represents this relationship between variables. There is an (un-directed) edge between variables a and b in the interference graph if variable a interferes with variable b.
  • Field Details

    • DEBUG

      public static boolean DEBUG
    • UNIQUE

      public static boolean UNIQUE
    • BEFORE

      public static final boolean BEFORE
      See Also:
    • AFTER

      public static final boolean AFTER
      See Also:
  • Constructor Details

    • Liveness

      public Liveness(FlowGraph cfg)
      Constructor.
      Parameters:
      cfg - Control flow graph on which to perform liveness analysis.
  • Method Details

    • removeVar

      public void removeVar(LocalExpr expr)
      Removes a local expression from the interference graph.
    • liveAtUse

      public boolean liveAtUse(VarExpr isLive, VarExpr at, boolean after)
      Should not be called.
    • liveAtStartOfBlock

      public boolean liveAtStartOfBlock(VarExpr isLive, Block block)
      Should not be called.
    • liveAtEndOfBlock

      public boolean liveAtEndOfBlock(VarExpr isLive, Block block)
      Should not be called.
    • defs

      public Collection defs()
      Returns the LocalExprs (variables) that occur in the CFG. They correspond to nodes in the interference graph.
    • intersections

      public Iterator intersections(VarExpr a)
      Returns an Iterator of LocalExprs that interfere with a given VarExpr.
    • liveRangesIntersect

      public boolean liveRangesIntersect(VarExpr a, VarExpr b)
      Determines whether or not two variables interfere with one another.