org.jikesrvm.compilers.opt.depgraph
Class DepGraphEdge

java.lang.Object
  extended by org.jikesrvm.compilers.opt.util.SpaceEffGraphEdge
      extended by org.jikesrvm.compilers.opt.depgraph.DepGraphEdge
All Implemented Interfaces:
DepGraphConstants, GraphEdge

public final class DepGraphEdge
extends SpaceEffGraphEdge
implements DepGraphConstants

Dependence graph edges: connect operands of different instructions represented by dependence graph nodes.


Field Summary
private  RegisterOperand _destOperand
          The destination operand (of a REG_TRUE dependence)
 
Fields inherited from class org.jikesrvm.compilers.opt.util.SpaceEffGraphEdge
_fromNode, _toNode, nextIn, nextOut, scratch
 
Fields inherited from interface org.jikesrvm.compilers.opt.depgraph.DepGraphConstants
COMPACT, CONTROL, EXCEPTION_E, EXCEPTION_ML, EXCEPTION_MS, EXCEPTION_R, GUARD_ANTI, GUARD_OUTPUT, GUARD_TRUE, MEM_ANTI, MEM_OUTPUT, MEM_READS_KILL, MEM_TRUE, REG_ANTI, REG_MAY_DEF, REG_OUTPUT, REG_TRUE, SEQ
 
Constructor Summary
DepGraphEdge(DepGraphNode sourceNode, DepGraphNode destNode, int depKind)
           
DepGraphEdge(RegisterOperand destOp, DepGraphNode sourceNode, DepGraphNode destNode, int depKind)
          Constructor for dependence graph edge of a REG_TRUE dependence from sourceNode to destNode due to destOp
 
Method Summary
(package private)  void addDepType(int type)
          Augment the type of the dependence edge.
(package private)  int depKind()
          Get the type of the dependence edge.
(package private)  RegisterOperand destOperand()
          Get the destination operand.
static DepGraphEdge findInputEdge(DepGraphNode n, Operand op)
          Return the input edge for a given node that corresponds to a given operand.
 String fromNodeString()
          Returns the string representation of the start node (used for printing).
 String getTypeString()
          Get the string representation of edge type (used for printing).
 boolean isControl()
          Does this edge represent a control dependence?
 boolean isExceptionE()
          Does this edge represent an exception-exception dependence?
 boolean isExceptionML()
          Does this edge represent an exception-load dependence?
 boolean isExceptionMS()
          Does this edge represent an exception-store dependence?
 boolean isExceptionR()
          Does this edge represent an exception-register live dependence?
 boolean isGuardAnti()
          Does this edge represent a guard anti-dependence?
 boolean isGuardOutput()
          Does this edge represent a guard output dependence?
 boolean isGuardTrue()
          Does this edge represent a guard true dependence?
 boolean isMemAnti()
          Does this edge represent a memory anti-dependence?
 boolean isMemOutput()
          Does this edge represent a memory output dependence?
 boolean isMemReadsKill()
          Does this edge represent a memory reads-kill dependence?
 boolean isMemTrue()
          Does this edge represent a memory true dependence?
 boolean isRegAnti()
          Does this edge represent a register anti-dependence?
static boolean isRegAnti(SpaceEffGraphEdge edge)
          Does a given edge represent a register anti-dependence?
 boolean isRegMayDef()
          Does this edge represent a register may def?
 boolean isRegOutput()
          Does this edge represent a register output dependence?
static boolean isRegOutput(SpaceEffGraphEdge edge)
          Does a given edge represent a register output dependence?
 boolean isRegTrue()
          Does this edge represent a register true dependence?
static boolean isRegTrue(SpaceEffGraphEdge edge)
          Does a given edge represent a register true dependence?
 String toNodeString()
          Returns the string representation of the end node (used for printing).
 String toString()
          Returns the string representation of the edge.
 
Methods inherited from class org.jikesrvm.compilers.opt.util.SpaceEffGraphEdge
backEdge, clearBackEdge, clearDominatorEdge, clearVisited, dominatorEdge, from, fromNode, getInfo, getNextIn, getNextOut, setBackEdge, setDominatorEdge, setInfo, setVisited, to, toNode, visited
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_destOperand

private RegisterOperand _destOperand
The destination operand (of a REG_TRUE dependence)

Constructor Detail

DepGraphEdge

DepGraphEdge(DepGraphNode sourceNode,
             DepGraphNode destNode,
             int depKind)
Parameters:
sourceNode - source dependence graph node
destNode - destination dependence graph node
depKind - the type of the dependence edge

DepGraphEdge

DepGraphEdge(RegisterOperand destOp,
             DepGraphNode sourceNode,
             DepGraphNode destNode,
             int depKind)
Constructor for dependence graph edge of a REG_TRUE dependence from sourceNode to destNode due to destOp

Parameters:
destOp - destination operand
sourceNode - source dependence graph node
destNode - destination dependence graph node
depKind - the type of the dependence edge
Method Detail

isRegTrue

public boolean isRegTrue()
Does this edge represent a register true dependence?

Returns:
true if yes, false otherwise

isRegAnti

public boolean isRegAnti()
Does this edge represent a register anti-dependence?

Returns:
true if yes, false otherwise

isRegOutput

public boolean isRegOutput()
Does this edge represent a register output dependence?

Returns:
true if yes, false otherwise

isRegMayDef

public boolean isRegMayDef()
Does this edge represent a register may def?

Returns:
true if yes, false otherwise

isMemTrue

public boolean isMemTrue()
Does this edge represent a memory true dependence?

Returns:
true if yes, false otherwise

isMemAnti

public boolean isMemAnti()
Does this edge represent a memory anti-dependence?

Returns:
true if yes, false otherwise

isMemOutput

public boolean isMemOutput()
Does this edge represent a memory output dependence?

Returns:
true if yes, false otherwise

isMemReadsKill

public boolean isMemReadsKill()
Does this edge represent a memory reads-kill dependence?

Returns:
true if yes, false otherwise

isControl

public boolean isControl()
Does this edge represent a control dependence?

Returns:
true if yes, false otherwise

isExceptionE

public boolean isExceptionE()
Does this edge represent an exception-exception dependence?

Returns:
true if yes, false otherwise

isExceptionMS

public boolean isExceptionMS()
Does this edge represent an exception-store dependence?

Returns:
true if yes, false otherwise

isExceptionML

public boolean isExceptionML()
Does this edge represent an exception-load dependence?

Returns:
true if yes, false otherwise

isExceptionR

public boolean isExceptionR()
Does this edge represent an exception-register live dependence?

Returns:
true if yes, false otherwise

isGuardTrue

public boolean isGuardTrue()
Does this edge represent a guard true dependence?

Returns:
true if yes, false otherwise

isGuardAnti

public boolean isGuardAnti()
Does this edge represent a guard anti-dependence?

Returns:
true if yes, false otherwise

isGuardOutput

public boolean isGuardOutput()
Does this edge represent a guard output dependence?

Returns:
true if yes, false otherwise

isRegTrue

public static boolean isRegTrue(SpaceEffGraphEdge edge)
Does a given edge represent a register true dependence? Use to avoid a cast from SpaceEffGraphEdge to DepGraphEdge.

Parameters:
edge - the edge to test
Returns:
true if yes, false otherwise

isRegAnti

public static boolean isRegAnti(SpaceEffGraphEdge edge)
Does a given edge represent a register anti-dependence? Use to avoid a cast from SpaceEffGraphEdge to DepGraphEdge.

Parameters:
edge - the edge to test
Returns:
true if yes, false otherwise

isRegOutput

public static boolean isRegOutput(SpaceEffGraphEdge edge)
Does a given edge represent a register output dependence? Use to avoid a cast from SpaceEffGraphEdge to DepGraphEdge.

Parameters:
edge - the edge to test
Returns:
true if yes, false otherwise

addDepType

void addDepType(int type)
Augment the type of the dependence edge.

Parameters:
type - the additional type for the edge

depKind

int depKind()
Get the type of the dependence edge.

Returns:
type of the dependence edge

destOperand

RegisterOperand destOperand()
Get the destination operand.

Returns:
destination operand

getTypeString

public String getTypeString()
Get the string representation of edge type (used for printing).

Overrides:
getTypeString in class SpaceEffGraphEdge
Returns:
string representation of edge type

toString

public String toString()
Returns the string representation of the edge.

Overrides:
toString in class Object
Returns:
string representation of the edge

toNodeString

public String toNodeString()
Returns the string representation of the end node (used for printing).

Overrides:
toNodeString in class SpaceEffGraphEdge
Returns:
string representation of the end node
See Also:
SpaceEffGraphEdge.toNodeString()

fromNodeString

public String fromNodeString()
Returns the string representation of the start node (used for printing).

Overrides:
fromNodeString in class SpaceEffGraphEdge
Returns:
string representation of the start node
See Also:
SpaceEffGraphEdge.fromNodeString()

findInputEdge

public static DepGraphEdge findInputEdge(DepGraphNode n,
                                         Operand op)
Return the input edge for a given node that corresponds to a given operand.

Parameters:
n - destination node
op - destination operand
Returns:
input edge or null if not found