scale.score.analyses
Class PlaceIndirectOpsSteen

java.lang.Object
  extended by scale.score.pred.Supertype
      extended by scale.score.pred.TraceChords
          extended by scale.score.analyses.PlaceIndirectOps
              extended by scale.score.analyses.PlaceIndirectOpsSteen
All Implemented Interfaces:
Predicate

public class PlaceIndirectOpsSteen
extends PlaceIndirectOps

This class visits nodes and places information, at specific nodes, which is used to represent aliases and indirect operations in SSA form.

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

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

We expect that alias analysis has been performed before we add information for indirection operations to the SSA form.

For now, we expect that Steensgaard's algorithm is used to create alias groups. An alias group is a collection of variables (and access paths) that contain the same alias relationships.


Field Summary
 
Fields inherited from class scale.score.analyses.PlaceIndirectOps
aliases, classTrace, trace
 
Fields inherited from class scale.score.pred.TraceChords
rl, thisChord, wl
 
Constructor Summary
PlaceIndirectOpsSteen(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
 void visitCallExpr(CallExpr e)
          We add Chi and Mu operators to routine calls to mark the use and definition of variables accross calls.
 void visitDualExpr(DualExpr e)
          Don't do anything here - but we don't want to default to visitExpr A Dual expression does not effect the placement of indirect operators.
 void visitExprChord(ExprChord c)
          We add a Chi operator to store operations that assign to indirect variables.
 void visitFieldExpr(FieldExpr e)
          Don't do anything here - but we don't want to default to visitExpr
 void visitLoadDeclValueExpr(LoadDeclValueExpr e)
          Add annotations to handle simple variable references that are aliases.
 void visitLoadValueIndirectExpr(LoadValueIndirectExpr e)
          We add a Mu operator to a use of an indirect variable.
 void visitSubscriptExpr(SubscriptExpr e)
          We don't need to do anything at a subscript expression.
 
Methods inherited from class scale.score.analyses.PlaceIndirectOps
addMayUse, addMayUse, addMayUse, addMayUse, createMayDefInfo, createMayDefInfo, getAliasVar, getAliasVar, getVirtualVar, setTrace
 
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, visitCallFunctionExpr, visitCallMethodExpr, visitCompareExpr, visitComplexValueExpr, visitConditionalExpr, visitConversionExpr, visitDecisionChord, visitDivisionExpr, visitEndChord, visitEqualityExpr, visitExitChord, visitExponentiationExpr, visitExpr, visitExprPhiExpr, visitGotoChord, visitGreaterEqualExpr, visitGreaterExpr, visitIfThenElseChord, visitLeaveChord, visitLessEqualExpr, visitLessExpr, visitLiteralExpr, visitLoadDeclAddressExpr, visitLoadExpr, visitLoadFieldAddressExpr, visitLoadFieldValueExpr, visitLoopExitChord, visitLoopHeaderChord, visitLoopInitChord, visitLoopPreHeaderChord, visitLoopTailChord, visitMarkerChord, visitMaxExpr, visitMinExpr, visitMultiplicationExpr, visitNaryExpr, visitNegativeExpr, visitNilExpr, visitNote, visitNotEqualExpr, visitNotExpr, visitNullChord, visitOrExpr, visitPhiExpr, visitPhiExprChord, visitRemainderExpr, visitReturnChord, visitSequentialChord, 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
 

Constructor Detail

PlaceIndirectOpsSteen

public PlaceIndirectOpsSteen(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

visitLoadDeclValueExpr

public void visitLoadDeclValueExpr(LoadDeclValueExpr e)
Add annotations to handle simple variable references that are aliases. We add a Mu operator for a use. Definitions are handled by Chi operators that are added to the ExprChord expression.

Specified by:
visitLoadDeclValueExpr in interface Predicate
Overrides:
visitLoadDeclValueExpr in class Supertype

visitLoadValueIndirectExpr

public void visitLoadValueIndirectExpr(LoadValueIndirectExpr e)
We add a Mu operator to a use of an indirect variable. Note that we handle assignments through indirect variables elsewhere. The Mu operator represents any variable that may be used via the indirect variable.

A LoadValueIndirectExpr represents a *expr operation.

Specified by:
visitLoadValueIndirectExpr in interface Predicate
Overrides:
visitLoadValueIndirectExpr in class Supertype
See Also:
LoadValueIndirectExpr

visitCallExpr

public void visitCallExpr(CallExpr e)
We add Chi and Mu operators to routine calls to mark the use and definition of variables accross calls. In the absence of MOD/REF information, we must assume that a function call defines and uses any global variable. Also, we must assume that the function call defines any parameter that is passed by address.

Overrides:
visitCallExpr in class Supertype

visitExprChord

public void visitExprChord(ExprChord c)
We add a Chi operator to store operations that assign to indirect variables. The Chi operator represents any variable that may be defined by the store (via the indirect variable).

Specified by:
visitExprChord in interface Predicate
Overrides:
visitExprChord in class Supertype

visitFieldExpr

public void visitFieldExpr(FieldExpr e)
Don't do anything here - but we don't want to default to visitExpr

Overrides:
visitFieldExpr in class Supertype

visitSubscriptExpr

public void visitSubscriptExpr(SubscriptExpr e)
We don't need to do anything at a subscript expression. So we just leave this function undefined - otherwise the visitExpr method is called.

Specified by:
visitSubscriptExpr in interface Predicate
Overrides:
visitSubscriptExpr in class Supertype

visitDualExpr

public void visitDualExpr(DualExpr e)
Don't do anything here - but we don't want to default to visitExpr A Dual expression does not effect the placement of indirect operators.

Specified by:
visitDualExpr in interface Predicate
Overrides:
visitDualExpr in class Supertype