|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object scale.score.trans.Optimization
public abstract class Optimization
This class is the base class for all optimizations performed on the CFG.
$Id: Optimization.java,v 1.27 2007-10-04 19:58:36 burrill Exp $
Copyright 2008 by the
Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
All optimizations applied to the CFG must be defined in this package and must be derived from this class.
Field Summary | |
---|---|
protected boolean |
dChanged
True if CFG nodes added or deleted by the optimization. |
static boolean |
fpReorder
True if floating point operations may be reordered. |
static boolean |
hasDummyAliases
True if there may be aliases between address arguments to subroutines. |
static int |
IN_SSA
The optimization requires that the CFG be in SSA form. |
static int |
minimumExecutionCost
Do not move expressions whose execution cost estimate is less than minimumExecutionCost. |
static int |
NA_SSA
The optimization does not require SSA form or non-SSA form. |
static int |
NO_SSA
The optimization requires that the CFG not be in SSA form. |
protected boolean |
rChanged
True if the variable references are no longer valid. |
protected Scribble |
scribble
The CFG. |
static boolean |
signedIntsWrapOnOverflow
Should signed integers wrap upon overflow? |
protected boolean |
trace
True if the optimization should be traced. |
protected UniqueName |
un
The name generator to use for any variables created. |
static boolean |
unsafe
True if unsafe optimuzations are allowd. |
static boolean |
unsignedIntsWrapOnOverflow
Should unsigned integers wrap upon overflow? |
static int |
VALID_SSA
The optimization requires that the CFG be in SSA form. |
Constructor Summary | |
---|---|
Optimization(Scribble scribble,
java.lang.String tempPrefix)
|
Method Summary | |
---|---|
boolean |
assertTrace(boolean trace,
java.lang.String msg,
boolean val)
Print out a trace message to System.out . |
boolean |
assertTrace(boolean trace,
java.lang.String msg,
double val)
Print out a trace message to System.out . |
boolean |
assertTrace(boolean trace,
java.lang.String msg,
long val)
Print out a trace message to System.out . |
boolean |
assertTrace(boolean trace,
java.lang.String msg,
java.lang.Object o)
Print out a trace message to System.out . |
boolean |
assertTrace(boolean trace,
java.lang.String msg,
Vector<? extends java.lang.Object> v)
Print out a trace message to System.out . |
protected VariableDecl |
genTemp(Type t)
Create a new temporary variable for use by the optimized code. |
static int |
insertStores(java.util.AbstractCollection<Chord> nodes,
Expr lhs,
Expr rhs)
Insert new copy CFG nodes between CFG nodes in the specified set and CFG nodes that are not in the set but have an edge to them from a node in the set. |
abstract void |
perform()
Perform the optimization. |
int |
requiresSSA()
Return whether this optimization requires that the CFG be in SSA form. |
protected boolean |
setTrace(boolean classTrace)
Sets the trace flag. |
static void |
sort(java.lang.Object[] v)
Place array elements in ascending lexigraphical order by CFG node execution order. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NO_SSA
public static final int IN_SSA
public static final int VALID_SSA
public static final int NA_SSA
public static int minimumExecutionCost
public static boolean unsafe
public static boolean fpReorder
public static boolean signedIntsWrapOnOverflow
public static boolean unsignedIntsWrapOnOverflow
public static boolean hasDummyAliases
protected Scribble scribble
protected UniqueName un
protected boolean dChanged
protected boolean rChanged
references
are no longer valid.
protected boolean trace
Constructor Detail |
---|
public Optimization(Scribble scribble, java.lang.String tempPrefix)
scribble
- is the CFG to be transformedtempPrefix
- is used to generate temporary variable namesMethod Detail |
---|
protected boolean setTrace(boolean classTrace)
trace
flag.
protected VariableDecl genTemp(Type t)
public abstract void perform()
Scribble
class provides methods that may be used to sepcify this
information.
public int requiresSSA()
public static void sort(java.lang.Object[] v)
v
- is an array of CFG nodes or expressionsChord.pushChordWhenReady(scale.common.Stack, int)
public static int insertStores(java.util.AbstractCollection<Chord> nodes, Expr lhs, Expr rhs)
nodes
- is the set of CFG nodeslhs
- is the left hand side for new CFG nodesrhs
- is the right hand side for new CFG nodes
public final boolean assertTrace(boolean trace, java.lang.String msg, java.lang.Object o)
System.out
. This
method is meant to be used in an assert
statement.
msg
- is the messageo
- is an object to append to the message
public final boolean assertTrace(boolean trace, java.lang.String msg, long val)
System.out
. This
method is meant to be used in an assert
statement.
msg
- is the messageval
- is an integer to append to the message
public final boolean assertTrace(boolean trace, java.lang.String msg, double val)
System.out
. This
method is meant to be used in an assert
statement.
msg
- is the messageval
- is an integer to append to the message
public final boolean assertTrace(boolean trace, java.lang.String msg, boolean val)
System.out
. This
method is meant to be used in an assert
statement.
msg
- is the messageval
- is an integer to append to the message
public final boolean assertTrace(boolean trace, java.lang.String msg, Vector<? extends java.lang.Object> v)
System.out
. This
method is meant to be used in an assert
statement.
msg
- is the messagev
- is a vector of things to display
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |