|
|||||||||
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.BasicBlockOps
public class BasicBlockOps
Perform optimizations on each basic block.
$Id: BasicBlockOps.java,v 1.57 2007-10-04 19:58:35 burrill Exp $
Copyright 2008 by the
Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
This module performs optimizations that are local to a basic block. For this module a basic block ends at a function call as well as at a branch point in the CFG. These optimizations do not require use-def links and may be performed in or out of SSA form. Current basic block optimizations:
Elimination of a store to a variable is legal
if:
beneficial
.
Eliminating a load increases the live range of any definition of a register value. This increases register pressure.
Elimination of a load from a variable is legal
if:
Replacing a reference to a constant with a reference to a variable
is legal
if the variable has been
loaded with the constant value previously in the basic block.
It is beneficial
if the cost of
generating the constant value in a register is greater than
minimumExecutionCost
.
Field Summary | |
---|---|
static boolean |
classTrace
True if traces are to be performed. |
static int |
maxBlockSize
Maximum number of CFG nodes that we will process in one "chunk". |
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 | |
---|---|
BasicBlockOps(Scribble scribble)
|
Method Summary | |
---|---|
static int |
constantEliminated()
Return the number of times the generation of a constant was eliminated. |
static int |
loadAddressEliminated()
Return the number of times the generation of a memory address was eliminated. |
static int |
loadArrayAddressEliminated()
Return the number of times the generation of an array element address was eliminated. |
static int |
loadEliminated()
Return the number of times a load from memory was eliminated. |
static int |
loadFieldAddressEliminated()
Return the number of times the generation of a structure field address was eliminated. |
static int |
loadFieldEliminated()
Return the number of times a load from a structure field was eliminated. |
static int |
loadIndirectEliminated()
Return the number of times a load indirect was eliminated. |
static int |
newCFGNodes()
Return the number of new nodes created. |
void |
perform()
Perform the actual basic block optimizations. |
int |
requiresSSA()
Return whether this optimization requires that the CFG be in SSA form. |
static int |
storeEliminated()
Return the number of times a load from memory was 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
public static int maxBlockSize
Constructor Detail |
---|
public BasicBlockOps(Scribble scribble)
scribble
- is the CFGMethod Detail |
---|
public static int newCFGNodes()
public static int loadEliminated()
public static int constantEliminated()
public static int storeEliminated()
public static int loadFieldEliminated()
public static int loadIndirectEliminated()
public static int loadAddressEliminated()
public static int loadFieldAddressEliminated()
public static int loadArrayAddressEliminated()
public void perform()
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 |