|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.compilers.opt.util.SpaceEffGraphNode org.jikesrvm.compilers.opt.controlflow.LSTNode org.jikesrvm.compilers.opt.controlflow.AnnotatedLSTNode
public final class AnnotatedLSTNode
A node in the LST (Loop Structure Tree) with added information on:
CFGTransformations
.
TODO:
LSTNode
Nested Class Summary | |
---|---|
(package private) static class |
AnnotatedLSTNode.BBEnum
This class implements an enumeration of BasicBlock s. |
private static class |
AnnotatedLSTNode.NonRegularLoopException
Exception thrown when a non-regular loop is encountered |
Nested classes/interfaces inherited from class org.jikesrvm.compilers.opt.controlflow.LSTNode |
---|
LSTNode.Edge |
Nested classes/interfaces inherited from class org.jikesrvm.compilers.opt.util.SpaceEffGraphNode |
---|
SpaceEffGraphNode.GraphEdgeEnumeration<T extends GraphEdge>, SpaceEffGraphNode.OutEdgeEnumeration |
Field Summary | |
---|---|
private Operand |
carriedLoopIterator
The iterator that is used to loop within the exit block |
ConditionOperand |
condition
The condition that is used to check for the end of loop |
private static boolean |
DEBUG
Flag to optionally print verbose debugging messages |
BasicBlock |
exit
The in loop block that either loops or leaves the loop |
private Instruction |
ifCmpInstr
The if instruction within the exit block |
Operand |
initialIteratorValue
The the initial iterator that comes into the phi node in the header |
private IR |
ir
A pointer to the governing IR |
private Instruction |
iteratorInstr
The instruction that modifies the iterator |
private Operand |
phiLoopIterator
The the phi iterator that gets modified by the stride to produce the carried iterator |
BasicBlock |
predecessor
The out of loop block before the header |
Operand |
strideValue
The stride operand to the iterator instruction |
BasicBlock |
successor
The out of loop block following the exit block |
Operand |
terminalIteratorValue
The value that ends the loop |
Fields inherited from class org.jikesrvm.compilers.opt.controlflow.LSTNode |
---|
depth, header, loop, loopExits, loopMultiplier |
Fields inherited from class org.jikesrvm.compilers.opt.util.SpaceEffGraphNode |
---|
_inEdgeEnd, _inEdgeStart, _outEdgeEnd, _outEdgeStart, info, next, nextSorted, prev, scratch, scratchObject |
Constructor Summary | |
---|---|
AnnotatedLSTNode(IR ir,
LSTNode node)
Constructor |
Method Summary | |
---|---|
private void |
checkInEdgesAreInLoop(BasicBlock block)
Check the edges into a block are from within the loop |
private void |
checkOutEdgesAreInLoop(BasicBlock block)
Check the edges out of a block are within the loop |
boolean |
contains(BasicBlock block)
Does this basic block appear in the loop? |
static Instruction |
definingInstruction(Operand op)
Find the instruction that defines an operand. |
void |
dump()
Dump a human readable description of the loop |
(package private) void |
dumpBlock(BasicBlock block)
Dump a human readable description of a basic block within the loop |
(package private) static void |
dumpInstruction(IR ir,
Instruction instr)
Dump a human readable description of an instruction within a basic block within the loop |
static Operand |
follow(Operand use)
Follow the operand's definition filtering out moves This code is taken and modified from an old LoopUnrolling |
Operand |
generateLoopInvariantOperand(BasicBlock block,
Operand op)
Loop invariants may not be accessible before a loop, so generate the instructions so they are |
Enumeration<BasicBlock> |
getBasicBlocks()
Return an enumeration of basic blocks corresponding to a depth first traversal of the blocks in the loops graphs |
private AnnotatedLSTNode.BBEnum |
getBasicBlocks(BasicBlock block,
AnnotatedLSTNode.BBEnum bbs,
BitVector blocksLeftToVisit)
Return an enumeration of basic blocks corresponding to a depth first traversal of the blocks in the loops graphs |
Operand |
getCarriedLoopIterator()
Get the carried loop iterator |
int |
getFixedDistanceFromPhiIterator(Operand op)
Get fixed distance from the phi iterator |
int |
getMonotonicStrideValue()
Return the stride value for monotonic loops |
(package private) static String |
instructionToString(IR ir,
Instruction instr)
Convert instruction to String in of AnnotatedLSTNode format |
boolean |
isAffineLoop()
Is this an affine loop of the form: predecessor: initialLoopIterator = ...; header: phiLoopIterator = phi (initialLoopIterator, carriedLoopIterator) ...body1... |
boolean |
isCarriedLoopIterator(Operand op)
Is this operand related to the carried iterator of this loop? |
(package private) static boolean |
isConstant(Operand op)
Test whether the operand is constant |
boolean |
isCountableLoop()
Is this a countable loop of the form: predecessor: initialLoopIterator = ConstantInitialValue; header: phiLoopIterator = phi (initialLoopIterator, carriedLoopIterator) ...body1... |
(package private) boolean |
isFixedDistanceFromPhiIterator(Operand op)
Is this operand a fixed distance from the phi iterator? |
boolean |
isInLoop(BasicBlock block)
Is the a particular block in this loop? |
boolean |
isInvariant(Operand op)
Is this value modified by the loop? |
private static boolean |
isLoopInvariant(Operand op,
BitVector loop,
BasicBlock header)
Test whether operand value will be invariant in a loop by tracing back earlier definitions. |
boolean |
isMonotonic()
Is the loop iterator monotonic? |
boolean |
isMonotonicDecreasing()
Is the loop iterator a monotonic decreasing value |
boolean |
isMonotonicIncreasing()
Is the loop iterator a monotonic increasing value |
boolean |
isNonRegularLoop()
Is this loop a non-regular loop? |
boolean |
isPhiLoopIterator(Operand op)
Is this operand related to the phi iterator of this loop? |
boolean |
isRelatedToIterator(Operand op)
Is this operand related to the iterator of this loop? |
private void |
perform()
Convert node into annotated format |
private void |
processExit()
Process the loop exit basic block |
private void |
processHeader()
Process the loop header basic block |
private void |
processLoopBlock(BasicBlock block)
Process a regular block within the loop |
String |
toString()
Converts the annotated loop to a concise string |
Methods inherited from class org.jikesrvm.compilers.opt.controlflow.LSTNode |
---|
addLoopExit, getChildren, getHeader, getLoop, getParent, initializeLoopExits |
Methods inherited from class org.jikesrvm.compilers.opt.util.SpaceEffGraphNode |
---|
_sortDFS, _sortRevTop, _sortTop, append, appendInEdge, appendOutEdge, clearDfsVisited, clearFlags, clearInFlags, clearLoopHeader, clearOnStack, clearOutFlags, clearTopVisited, deleteIn, deleteOut, deleteOut, deleteOut, dfsVisited, findOutEdgeTo, firstInEdge, firstInNode, firstOutEdge, firstOutNode, flagsOn, getIndex, getNext, getNumber, getNumberOfIn, getNumberOfOut, getPrev, getScratch, hasIn, hasOneIn, hasOneIn, hasOneOut, hasOneOut, hasOut, hasZeroIn, hasZeroOut, inEdges, inNodes, insertOut, insertOut, isLoopHeader, markDFN, markSCC, onStack, outEdges, outNodes, pointsIn, pointsOut, printExtended, printInEdges, printInNodes, printOutEdges, printOutNodes, remove, removeIn, removeIn, removeOut, removeOut, replaceInEdge, replaceOut, setDfsVisited, setDfsVisitedOnStack, setIndex, setLoopHeader, setNumber, setOnStack, setScratch, setTopVisited, sortDFS, sortRevTop, sortTop, topVisited |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final boolean DEBUG
private final IR ir
public BasicBlock predecessor
public BasicBlock exit
public BasicBlock successor
private Instruction ifCmpInstr
private Instruction iteratorInstr
public Operand initialIteratorValue
private Operand carriedLoopIterator
private Operand phiLoopIterator
public Operand terminalIteratorValue
public ConditionOperand condition
public Operand strideValue
Constructor Detail |
---|
public AnnotatedLSTNode(IR ir, LSTNode node)
ir
- The containing IRnode
- The node that's being annotatedMethod Detail |
---|
public boolean isCountableLoop()
public boolean isAffineLoop()
public boolean isNonRegularLoop()
public boolean isInvariant(Operand op)
public boolean isRelatedToIterator(Operand op)
op
- Operand to test
public boolean isPhiLoopIterator(Operand op)
op
- Operand to test
public boolean isCarriedLoopIterator(Operand op)
op
- Operand to test
public boolean isMonotonic()
public int getMonotonicStrideValue()
public boolean isMonotonicIncreasing()
public boolean isMonotonicDecreasing()
public boolean contains(BasicBlock block)
public String toString()
toString
in class LSTNode
public void dump()
void dumpBlock(BasicBlock block)
block
- The basic block to dumpstatic void dumpInstruction(IR ir, Instruction instr)
ir
- Containing IRinstr
- The instruction to dumpstatic String instructionToString(IR ir, Instruction instr)
ir
- Containing IRinstr
- The instruction to dumpstatic boolean isConstant(Operand op)
op
- Operand to determine whether it's constant
boolean isFixedDistanceFromPhiIterator(Operand op)
op
- the operand to test
public int getFixedDistanceFromPhiIterator(Operand op)
op
- the operand to test
private static boolean isLoopInvariant(Operand op, BitVector loop, BasicBlock header)
LoopUnrolling
.
op
- Operand to determine whether it's invariantloop
- Loop in which we wish to know the invariance of the operandheader
- The loop header for determining if PEIs are invariant
public Operand generateLoopInvariantOperand(BasicBlock block, Operand op)
block
- to generate instructions intoop
- the operand we hope to use before the looppublic static Operand follow(Operand use)
LoopUnrolling
use
- Operand to follow
public static Instruction definingInstruction(Operand op)
op
- The operand we're searching for the definition ofpublic boolean isInLoop(BasicBlock block)
true
iff block is in the loopprivate AnnotatedLSTNode.BBEnum getBasicBlocks(BasicBlock block, AnnotatedLSTNode.BBEnum bbs, BitVector blocksLeftToVisit)
block
- block to visitbbs
- enumeration so farblocksLeftToVisit
- blocks left to visit
public Enumeration<BasicBlock> getBasicBlocks()
private void checkOutEdgesAreInLoop(BasicBlock block) throws AnnotatedLSTNode.NonRegularLoopException
block
- to check
AnnotatedLSTNode.NonRegularLoopException
private void checkInEdgesAreInLoop(BasicBlock block) throws AnnotatedLSTNode.NonRegularLoopException
block
- to check
AnnotatedLSTNode.NonRegularLoopException
private void perform() throws OptimizingCompilerException
OptimizingCompilerException
private void processHeader() throws AnnotatedLSTNode.NonRegularLoopException
AnnotatedLSTNode.NonRegularLoopException
private void processExit() throws AnnotatedLSTNode.NonRegularLoopException
AnnotatedLSTNode.NonRegularLoopException
private void processLoopBlock(BasicBlock block) throws AnnotatedLSTNode.NonRegularLoopException
block
- The basic block to process
AnnotatedLSTNode.NonRegularLoopException
public Operand getCarriedLoopIterator()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |