|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object scale.score.trans.Optimization scale.score.trans.SFIR
public class SFIR
This class replaces references to fields of C structures with references to local variables.
$Id: SFIR.java,v 1.25 2007-08-10 14:35:19 burrill Exp $
Copyright 2008 by the
Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
This optimization attempts to replace multiple references to a
field of a struct
variable with a reference to a
surrogate variable (allocated to a register) in the hopes of
eliminating references to memory.
If the variable is used just within one function, the variable is
never referenced as a whole, no aliases are created for any field,
and it is not possible for any of the fields of the variable to be
referenced outside of the function, each field of the variable may
be replaced with a new variable that may be allocted to memory. In
these circumstances, the struct
is eliminated all
together.
Register pressure is always increased because a new variable is
introduced that has a live range that is always greater than the
live range of the reference to the struct
field it
represents.
A transformation is legal
if:
struct
variable's address is not taken, and
struct
variable is not volatile
.
beneficial
if:
Field Summary | |
---|---|
static boolean |
classTrace
True if traces are to be performed. |
static boolean |
useHeuristics
If true, use heuristics that prune the cases where the optimization is applied. |
Fields inherited from class scale.score.trans.Optimization |
---|
dChanged, fpReorder, hasDummyAliases, IN_SSA, minimumExecutionCost, NA_SSA, NO_SSA, rChanged, scribble, signedIntsWrapOnOverflow, trace, un, unsafe, unsignedIntsWrapOnOverflow, VALID_SSA |
Constructor Summary | |
---|---|
SFIR(Scribble scribble)
|
Method Summary | |
---|---|
static int |
newCFGNodes()
Return the number of new nodes created. |
static int |
outOfLoops()
Return the current number of loads placed outside of loops. |
void |
perform()
Perform the optimization. |
static int |
replacedLoads()
Return the current number of array loads replaced. |
int |
requiresSSA()
Specify that this optimization requires that the CFG NOT be in SSA form. |
static int |
varsEliminated()
Return the number of struct variables eliminated.. |
Methods inherited from class scale.score.trans.Optimization |
---|
assertTrace, assertTrace, assertTrace, assertTrace, assertTrace, genTemp, insertStores, setTrace, sort |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean classTrace
public static boolean useHeuristics
Constructor Detail |
---|
public SFIR(Scribble scribble)
Method Detail |
---|
public static int replacedLoads()
public static int outOfLoops()
public static int newCFGNodes()
public static int varsEliminated()
public void perform()
Optimization
Scribble
class provides methods that may be used to sepcify this
information.
perform
in class Optimization
public int requiresSSA()
requiresSSA
in class Optimization
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |