scale.score.analyses
Class PlaceIndirectOps

java.lang.Object
  extended by scale.score.pred.Supertype
      extended by scale.score.pred.TraceChords
          extended by scale.score.analyses.PlaceIndirectOps
All Implemented Interfaces:
Predicate
Direct Known Subclasses:
PlaceIndirectOpsSH, PlaceIndirectOpsSteen

public abstract class PlaceIndirectOps
extends TraceChords

This is the base class for generating information, at specific nodes, which is used to represent aliases and indirect operations in SSA form.

$Id: PlaceIndirectOps.java,v 1.56 2007-10-04 19:58:21 burrill Exp $

Copyright 2008 by the Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.


Field Summary
protected  Aliases aliases
          Alias analysis used.
static boolean classTrace
          True if traces are to be performed.
protected  boolean trace
          Set true to trace operation.
 
Fields inherited from class scale.score.pred.TraceChords
rl, thisChord, wl
 
Constructor Summary
PlaceIndirectOps(Aliases aliases)
          Construct an object to place special annotations in a Scribble graph so that we can correctly handle indirect operations and aliases.
 
Method Summary
protected  void addMayUse(LoadDeclValueExpr le, ECR ecr)
          Specify that the specified variable access may reference the same location as other references.
protected  void addMayUse(LoadDeclValueExpr le, VirtualVar v)
          Specify that the specified variable access may reference the same location as other references.
protected  void addMayUse(LoadValueIndirectExpr le, ECR ecr)
          Specify that the specified variable access may reference the same location as other references.
protected  void addMayUse(LoadValueIndirectExpr le, VirtualVar v)
          Specify that the specified variable access may reference the same location as other references.
protected  MayDef createMayDefInfo(ECR ecr)
          Create a may definition expression to repesent the aliasing characteristics of an expression.
protected  MayDef createMayDefInfo(VirtualVar v)
          Create a may definition expression to repesent the aliasing characteristics of an expression.
protected  AliasVar getAliasVar(Declaration d)
          Get the alias information from a Scribble expression node.
protected  AliasVar getAliasVar(Expr exp)
          Get the alias variable associated with a Scribble operator.
 VirtualVar getVirtualVar(ECR ecr)
          Return the virtual variable associated with the ECR or create a new virtual var if there isn't one already.
 void setTrace(boolean trace)
          Set the trace flag.
 
Methods inherited from class scale.score.pred.TraceChords
getChord, setChord, visitChord
 
Methods inherited from class scale.score.pred.Supertype
visitAbsoluteValueExpr, visitAdditionExpr, visitAllocateExpr, visitAndExpr, visitArrayIndexExpr, visitBeginChord, visitBinaryExpr, visitBitAndExpr, visitBitComplementExpr, visitBitOrExpr, visitBitShiftExpr, visitBitXorExpr, visitBranchChord, visitCallExpr, visitCallFunctionExpr, visitCallMethodExpr, visitCompareExpr, visitComplexValueExpr, visitConditionalExpr, visitConversionExpr, visitDecisionChord, visitDivisionExpr, visitDualExpr, visitEndChord, visitEqualityExpr, visitExitChord, visitExponentiationExpr, visitExpr, visitExprChord, visitExprPhiExpr, visitFieldExpr, visitGotoChord, visitGreaterEqualExpr, visitGreaterExpr, visitIfThenElseChord, visitLeaveChord, visitLessEqualExpr, visitLessExpr, visitLiteralExpr, visitLoadDeclAddressExpr, visitLoadDeclValueExpr, visitLoadExpr, visitLoadFieldAddressExpr, visitLoadFieldValueExpr, visitLoadValueIndirectExpr, visitLoopExitChord, visitLoopHeaderChord, visitLoopInitChord, visitLoopPreHeaderChord, visitLoopTailChord, visitMarkerChord, visitMaxExpr, visitMinExpr, visitMultiplicationExpr, visitNaryExpr, visitNegativeExpr, visitNilExpr, visitNote, visitNotEqualExpr, visitNotExpr, visitNullChord, visitOrExpr, visitPhiExpr, visitPhiExprChord, visitRemainderExpr, visitReturnChord, visitSequentialChord, visitSubscriptExpr, visitSubtractionExpr, visitSwitchChord, visitTernaryExpr, visitTranscendental2Expr, visitTranscendentalExpr, visitUnaryExpr, visitVaArgExpr, visitVaEndExpr, visitValueExpr, visitVarArgExpr, visitVaStartExpr, visitVectorExpr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classTrace

public static boolean classTrace
True if traces are to be performed.


trace

protected boolean trace
Set true to trace operation.


aliases

protected Aliases aliases
Alias analysis used.

Constructor Detail

PlaceIndirectOps

public PlaceIndirectOps(Aliases aliases)
Construct an object to place special annotations in a Scribble graph so that we can correctly handle indirect operations and aliases.

Method Detail

setTrace

public void setTrace(boolean trace)
Set the trace flag.


getVirtualVar

public VirtualVar getVirtualVar(ECR ecr)
Return the virtual variable associated with the ECR or create a new virtual var if there isn't one already.

Parameters:
ecr - an ECR that represents a virtual variable.
Returns:
the virtual variable associated with the ECR.

getAliasVar

protected AliasVar getAliasVar(Declaration d)
Get the alias information from a Scribble expression node. The alias information is placed on declaration nodes as annotations. The declaration nodes are attached to Scribble load nodes.

Parameters:
d - the declaration node that contains the alias annotation
Returns:
the alias variable associated with the declaration.

getAliasVar

protected AliasVar getAliasVar(Expr exp)
Get the alias variable associated with a Scribble operator. Most Scribble operators do not have alias variables so this routine returns null. Typically, the alias variable information is attached to the declaration node associated with the load operations. However, we sometimes need to create alias variables to hold alias information that is not directly assigned to a user variable (e.g., **x).

For LoadDeclValueExpr and LoadDeclAddressExpr the information is located in the "extra" information. For LoadValueIndirectExpr, the information is located in the operand.

Parameters:
exp - is the expression representing the operator.
Returns:
the alias variable associated with a Scribble operator.

addMayUse

protected void addMayUse(LoadDeclValueExpr le,
                         VirtualVar v)
Specify that the specified variable access may reference the same location as other references.


addMayUse

protected void addMayUse(LoadDeclValueExpr le,
                         ECR ecr)
Specify that the specified variable access may reference the same location as other references.


addMayUse

protected void addMayUse(LoadValueIndirectExpr le,
                         VirtualVar v)
Specify that the specified variable access may reference the same location as other references.


addMayUse

protected void addMayUse(LoadValueIndirectExpr le,
                         ECR ecr)
Specify that the specified variable access may reference the same location as other references.


createMayDefInfo

protected MayDef createMayDefInfo(VirtualVar v)
Create a may definition expression to repesent the aliasing characteristics of an expression.

Parameters:
v - is the equivalence class that the may def is associated with
Returns:
the may definition expression

createMayDefInfo

protected MayDef createMayDefInfo(ECR ecr)
Create a may definition expression to repesent the aliasing characteristics of an expression.

Parameters:
ecr - the equivalence class that the may def is associated with
Returns:
the may definition expression