|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object scale.common.Root scale.score.Note scale.score.expr.Expr scale.score.expr.LoadExpr
public abstract class LoadExpr
This class is the base class for expressions that represent references to memory.
$Id: LoadExpr.java,v 1.90 2007-10-17 13:40:00 burrill Exp $
Copyright 2008 by the
Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
This class represents use-def chains.
Field Summary |
---|
Fields inherited from class scale.score.expr.Expr |
---|
fpReorder, SE_DOMAIN, SE_NONE, SE_OVERFLOW, SE_STATE |
Constructor Summary | |
---|---|
protected |
LoadExpr()
|
|
LoadExpr(Type t,
Declaration decl)
|
Method Summary | |
---|---|
void |
addMayUse(MayUse mayUse)
Add may use information to the load expression. |
long |
canonical()
Return a unique value representing this particular expression. |
boolean |
containsDeclaration(Declaration decl)
Return true if this expression contains a reference to the variable. |
abstract Expr |
copyNoUD()
Make a copy of this load expression without the use - def information. |
boolean |
dependsOnDeclaration(Declaration decl)
Return true if this expression's value depends on the variable. |
boolean |
equivalent(Expr exp)
Return true if the expressions are equivalent. |
SubscriptExpr |
findSubscriptExpr()
Return the SubscriptExpr that this load
uses or null if none is found. |
AliasAnnote |
getAliasAnnote()
Get the alias annotation associated with a Scribble operator. |
Declaration |
getDecl()
Return the Clef declaration of the variable being loaded. |
void |
getDeclList(java.util.AbstractCollection<Declaration> varList)
Add all declarations referenced in this expression to the Vector. |
void |
getExprList(Vector<Expr> expList)
Add all Expr instances in this expression to the Vector. |
void |
getLoadExprList(Vector<LoadExpr> expList)
Add all LoadExpr instances in this expression to the Vector. |
MayUse |
getMayUse()
Return the may use information assocaited with the load. |
java.lang.String |
getName()
Return the name of the declaration being loaded. |
Expr |
getObject()
Given a load expression, return the object expression for the load. |
Expr[] |
getOperandArray()
Return an array of the operands to the expression. |
Expr |
getReference()
Return the value associated with the load expression. |
int |
getReuseLevel()
|
Declaration |
getSubsetDecl()
Return the original declaration of the value loaded. |
ExprChord |
getUseDef()
Return the ExprChord that defines
the value load by this load expression. |
boolean |
isMemoryDef()
Return true if the node reference is a definition. |
boolean |
isMemRefExpr()
Return true if the expression loads a value from memory. |
void |
loopClean()
Clean up any loop related information. |
int |
numOperands()
Return the number of operands to this expression. |
void |
pushOperands(Stack<Expr> wl)
Push all of the operands of this expression on the Stack. |
void |
recordRefs(Chord stmt,
References refs)
Record any variable references in this expression in the table of references. |
boolean |
referencesVariableInCommon()
Return true if the variable referenced is in Fortran COMMON. |
void |
removeRefs(Chord stmt,
References refs)
Remove any variable references in this expression from the table of references. |
void |
removeUseDef()
Remove any use - def links, may - use links, etc. |
boolean |
replaceDecl(Declaration oldDecl,
Declaration newDecl)
Replace all occurrances of a Declaration with another Declaration. |
void |
setCrossloopReuse(int level)
|
void |
setDecl(Declaration decl)
Change the declaration associated with the load operation. |
void |
setSpatialReuse(int level)
|
void |
setStep(int step)
|
void |
setTemporalReuse(int level)
|
void |
setUseDef(ExprChord expr)
Define a link from this load of a value to the scale.score.chords.ExprChord that defines the value. |
static boolean |
setUseMayUse(boolean flg)
Specify whether the equivalent() method should use
the may-use information. |
static boolean |
setUseOriginal(boolean flg)
Specify whether the equivalent() method should use the non-SSA original VariableDecl . |
int |
sideEffects()
Return an indication of the side effects execution of this expression may cause. |
void |
unlinkExpression()
If the node is no longer needed, sever its use-def link, etc. |
void |
validate()
Check this node for validity. |
boolean |
validLValue()
Return true if this expression is valid on the left side of an assignment. |
Methods inherited from class scale.score.Note |
---|
executionCostEstimate, getChord, getEssentialUse, setAnnotationLevel, setReportLevel, toString, visit |
Methods inherited from class scale.common.Root |
---|
addAnnotation, allAnnotations, allMatchingAnnotations, getAnnotation, getDisplayName, getDisplayString, getNodeCount, getNodeID, hasAnnotation, hasEqualAnnotation, hashCode, removeAnnotation, removeAnnotations, toStringAnnotations, toStringClass, trace, trace, trace |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LoadExpr(Type t, Declaration decl)
protected LoadExpr()
Method Detail |
---|
public Declaration getSubsetDecl()
public boolean equivalent(Expr exp)
equivalent
in class Expr
setUseOriginal(boolean)
public static boolean setUseOriginal(boolean flg)
VariableDecl
.
equivalent(scale.score.expr.Expr)
,
PRE
public static boolean setUseMayUse(boolean flg)
equivalent()
method should use
the may-use information.
equivalent(scale.score.expr.Expr)
,
ValNum
public abstract Expr copyNoUD()
public final void setUseDef(ExprChord expr)
setUseDef
in class Expr
expr
- the new use-def linkpublic final ExprChord getUseDef()
ExprChord
that defines
the value load by this load expression.
getUseDef
in class Expr
public void addMayUse(MayUse mayUse)
mayUse
- the expresion representing the may usepublic final MayUse getMayUse()
public void removeUseDef()
removeUseDef
in class Expr
public final Declaration getDecl()
public final void setDecl(Declaration decl)
decl
- is the new declataionpublic java.lang.String getName()
public final Expr[] getOperandArray()
getOperandArray
in class Expr
public final int numOperands()
numOperands
in class Expr
public Expr getReference()
getReference
in class Expr
public Expr getObject()
public long canonical()
canonical
in class Expr
public void loopClean()
loopClean
in class Expr
public void unlinkExpression()
unlinkExpression
in class Expr
public boolean isMemoryDef()
isMemoryDef
in class Expr
public SubscriptExpr findSubscriptExpr()
SubscriptExpr
that this load
uses or null
if none is found. This method uses the
use-def link to find an existing SubscriptExpr
findSubscriptExpr
in class Expr
public void setTemporalReuse(int level)
setTemporalReuse
in class Expr
public void setCrossloopReuse(int level)
setCrossloopReuse
in class Expr
public void setSpatialReuse(int level)
setSpatialReuse
in class Expr
public void setStep(int step)
setStep
in class Expr
public int getReuseLevel()
getReuseLevel
in class Expr
public boolean isMemRefExpr()
isMemRefExpr
in class Expr
public final boolean referencesVariableInCommon()
public boolean validLValue()
validLValue
in class Expr
public final boolean containsDeclaration(Declaration decl)
containsDeclaration
in class Expr
setUseOriginal(boolean)
public final boolean dependsOnDeclaration(Declaration decl)
dependsOnDeclaration
in class Expr
setUseOriginal(boolean)
public AliasAnnote getAliasAnnote()
getAliasAnnote
in class Expr
public void getDeclList(java.util.AbstractCollection<Declaration> varList)
getDeclList
in class Expr
public void getLoadExprList(Vector<LoadExpr> expList)
getLoadExprList
in class Expr
public void getExprList(Vector<Expr> expList)
getExprList
in class Expr
public void pushOperands(Stack<Expr> wl)
pushOperands
in class Expr
public boolean replaceDecl(Declaration oldDecl, Declaration newDecl)
replaceDecl
in class Expr
public void validate()
validate
in class Expr
public void recordRefs(Chord stmt, References refs)
recordRefs
in class Expr
public void removeRefs(Chord stmt, References refs)
removeRefs
in class Expr
public int sideEffects()
sideEffects
in class Expr
Expr.SE_NONE
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |