|
|||||||||
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.URJ
public class URJ
This class performs unroll & jam.
$Id: URJ.java,v 1.123 2007-10-29 13:42:27 burrill Exp $
Copyright 2008 by the
Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
For each loop, we first try to flatten it. If that fails, we next try to unroll it as a for-loop. If that fails, we try to unroll it as a while-loop. If that fails, we give up. The following is the decision tree for this process. By flattening, we mean unrolling the loop by its known iteration count, removing the exit test, and removing the back edge of the loop.
For target architectures that have instruction blocks of fixed size (e.g., Trips), an attempt is made to unroll or flatten so that the blocks are filled.
Field Summary | |
---|---|
static boolean |
classTrace
True if traces are to be performed. |
static int |
defaultMinUnrollFactor
Controls the number of times a loop is unrolled. |
static boolean |
doPropagation
Do back propagation of induction variables after unrolling. |
static boolean |
inhibitFlattenLoops
If true, inhibits loop flattening. |
static boolean |
inhibitForLoops
If true, inhibits for-loop unrolling. |
static boolean |
inhibitWhileLoops
If true, inhibits while-loop unrolling. |
static int |
maxLoopBlocks
The maximum size, in "blocks", of an unrolled or flattened loop when using instruction estimates. |
static int |
maxLoopCFGNodes
The maximum size, in CFG nodes, of an unrolled or flattened loop. |
static double |
minLoopHeaderExecRatio
If path profiling is used, this is the minimum execution ratio that a loop header needs in order for its loop to be unrolled. |
static int |
minNewAvgTripCount
If path profiling is used and the exact loop iteration is not known, this is the minimum allowed trip count of the unrolled loop. |
static boolean |
peel
True if loop peeling is to be performed. |
static boolean |
useHeuristics
If true, use heuristics that prune the cases where the optimization is applied. |
static boolean |
useInstCountEstimates
If true, use estimated instruction counts instead of node counts. |
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 | |
---|---|
URJ(Scribble scribble)
|
Method Summary | |
---|---|
static int |
flattened()
Return the number of loops that were flattened. |
java.lang.String |
getUnrollLoopKindString(int loopKind)
Convert the unroll status to a string for display. |
static int |
newCFGNodes()
Return the number of new nodes created. |
void |
perform()
Perform the optimization. |
int |
requiresSSA()
Return whether this optimization requires that the CFG be in SSA form. |
static int |
unrolled()
Return the number of for loops that were unrolled. |
static int |
unrolledWhile()
Return the number of while loops that were unrolled. |
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 doPropagation
public static int maxLoopCFGNodes
public static int maxLoopBlocks
public static boolean classTrace
public static boolean useHeuristics
public static boolean useInstCountEstimates
maxLoopCFGNodes
, the
value of maxLoopBlocks
×Machine.getMaxBlockSize()
is used determine the maximum loop size.
public static boolean peel
public static int defaultMinUnrollFactor
public static boolean inhibitWhileLoops
public static boolean inhibitForLoops
public static boolean inhibitFlattenLoops
public static double minLoopHeaderExecRatio
public static int minNewAvgTripCount
Constructor Detail |
---|
public URJ(Scribble scribble)
Method Detail |
---|
public static int unrolled()
public static int unrolledWhile()
public static int flattened()
public static int newCFGNodes()
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
public java.lang.String getUnrollLoopKindString(int loopKind)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |