|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object scale.common.Root scale.backend.Node scale.backend.trips2.PredicateBlock
public class PredicateBlock
This class represents a predicated basic block.
$Id: PredicateBlock.java,v 1.53 2007-10-04 19:57:59 burrill Exp $
Copyright 2008 by the
Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
A predicated block is similar to a traditional basic block, except that a predicate can be associated with the block. All instructions in the block are predicated on that predicate. If no predicate is specified, all instructions are considered to be unpredicated.
A hyperblock is made up of a collection of predicated blocks.
Field Summary |
---|
Fields inherited from class scale.backend.Node |
---|
color, label, predecessors, successors, tag |
Constructor Summary | |
---|---|
PredicateBlock()
Construct an unpredicated block. |
|
PredicateBlock(Instruction first,
Instruction last)
Construct an unpredicated block beginning with first. |
|
PredicateBlock(int[] predicates,
boolean predicatedOnTrue)
Construct a predicated block. |
|
PredicateBlock(int predicate,
boolean predicatedOnTrue)
Construct a predicated block. |
Method Summary | |
---|---|
void |
addSpill(int size)
Add a spill to the predicate block. |
void |
analyze(IntMap<Vector<java.lang.Integer>> targets,
IntMap<java.lang.Integer> uses,
BitVect mov3)
This routine will determine the block size (including estimated fanout), the highest load/store queue id, and the number of branches. |
void |
appendInstruction(Instruction inst)
Append the instruction to the end of the predicate block. |
void |
appendInstruction(Instruction inst,
SSA ssa)
Append the instruction to the end of the predicate block and maintain SSA form. |
static int |
blocksSplit()
Return the number of blocks split. |
PredicateBlock |
copy()
Copy the block. |
PredicateBlock |
cut(Instruction split,
Trips2Generator gen)
Return a new block starting with the instructions after the split point. |
static int |
dummyStores()
Return the number of dummy stores inserted. |
int |
estimateFanout(Instruction inst,
IntMap<Vector<java.lang.Integer>> targets,
IntMap<java.lang.Integer> uses,
BitVect mov3)
This routine computes the fanout needed for the operands of an instruction. |
int |
estimateNumInstructions(Instruction inst)
Return the number of real instructions needed to represent this instruction. |
int |
getBlockSize()
Return the size of the instructions in the block (not including fanout). |
DColor |
getDisplayColorHint()
Return a String specifying the color to use for coloring this node in a graphical display. |
java.lang.String |
getDisplayLabel()
Return a String suitable for labeling this node in a graphical display. |
java.lang.String |
getDisplayName()
Return the unique node label. |
DShape |
getDisplayShapeHint()
Return a String specifying a shape to use when drawing this node in a graphical display. |
int |
getFanout()
Return the estimated fanout for the block. |
Instruction |
getFirstInstruction()
Return the first instruction in this block. |
Instruction |
getLastInstruction()
Return the last instruction in this block. |
int |
getPredicate()
Return the predicate for this block. |
int[] |
getPredicates()
Return the predicates for this block. |
int |
getSpillSize()
Return the size of the spills in the block. |
java.lang.String |
getStats()
|
boolean |
hasBranch()
Return true if this block has a branch. |
boolean |
hasCall()
Return true if this block has a function call. |
boolean |
hasDummyStores()
Return true if this block has any "dummy" stores inserted for store nullification. |
boolean |
hasSwitch()
Return true if this block has a switch. |
Instruction |
insertInstructionAfter(Instruction after,
Instruction inst)
Insert an instruction after the specified instruction. |
void |
insertInstructionAtHead(Instruction inst)
Insert an instruction at the beginning of the block. |
void |
insertInstructionBeforeBranch(Instruction inst)
Insert an instruction at the end of a block before the branch (if it exists). |
boolean |
isLegalBlock()
Return true if this is a well formed TRIPS block. |
boolean |
isPredicated()
Return true if the instruction is predicated. |
boolean |
isPredicatedOnTrue()
Return true if this block is predicated on the predicate evaluating to true. |
boolean |
isSplitPoint()
Return true if this block is a good candidate for reverse if-conversion. |
int |
maxLSID()
Return the highest assigned load/store ID in the block. |
void |
nextVisit()
The next unique color for traversing the graph. |
protected void |
nullifyStores(BitVect nulls,
SSA ssa,
Trips2RegisterSet registers)
Insert a null and a dummy store in the block. |
static int |
nullStoresInserted()
Return the number of nulls inserted. |
int |
numSpills()
Return the number of spills in the block. |
protected void |
removeDummyStores(SSA ssa)
Remove any dummy stores that were inserted by store nullification. |
void |
removeInstruction(Instruction inst)
Delete the specified instruction. |
void |
removeInstruction(Instruction prev,
Instruction inst)
Delete the specified instruction. |
void |
removePredicates()
Remove the predicates from a block. |
protected void |
removeSpillCode()
Remove spill code from a block. |
void |
setFirstInstruction(Instruction first)
Set the first instruction in this block. |
void |
setHasBranch()
Set that the block has a branch. |
void |
setLastInstruction(Instruction last)
Set the last instruction in this block. |
void |
setMaxLSID(int maxLSID)
|
void |
setPredicate(int predicate)
Set the predicate for this block. |
void |
setPredicate(int predicate,
boolean onTrue)
Set the predicate for this block. |
void |
setPredicates(int[] predicates)
Set the predicates for this block. |
void |
setSplitPoint()
Set that the block is a good candidate for reverse if-conversion. |
void |
setVisited()
Mark that the block has been visited. |
java.lang.String |
toString()
Returns a description of the block. |
boolean |
visited()
Return true if the block has been visited. |
Methods inherited from class scale.backend.Node |
---|
addInEdge, addOutEdge, deleteInEdge, deleteOutEdge, getInEdge, getInEdges, getLabel, getOutEdge, getOutEdges, getTag, indexOfInEdge, indexOfOutEdge, numInEdges, numOutEdges, pushInEdges, pushInEdges, pushOutEdges, pushOutEdges, replaceInEdge, replaceOutEdge, setLabel, setTag, unlink |
Methods inherited from class scale.common.Root |
---|
addAnnotation, allAnnotations, allMatchingAnnotations, getAnnotation, getDisplayString, getNodeCount, getNodeID, hasAnnotation, hasEqualAnnotation, hashCode, removeAnnotation, removeAnnotations, toStringAnnotations, toStringClass, toStringSpecial, trace, trace, trace |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PredicateBlock()
public PredicateBlock(Instruction first, Instruction last)
public PredicateBlock(int predicate, boolean predicatedOnTrue)
public PredicateBlock(int[] predicates, boolean predicatedOnTrue)
Method Detail |
---|
public static int blocksSplit()
public static int nullStoresInserted()
public static int dummyStores()
public final void setVisited()
setVisited
in class Node
public final boolean visited()
visited
in class Node
public final void nextVisit()
nextVisit
in class Node
public final int getBlockSize()
public final int getFanout()
public final int maxLSID()
public final void setMaxLSID(int maxLSID)
public final boolean isSplitPoint()
public final void setSplitPoint()
public final boolean hasBranch()
public final boolean hasCall()
public final boolean hasSwitch()
public final void setHasBranch()
public final int numSpills()
public final int getSpillSize()
public final void addSpill(int size)
public final boolean hasDummyStores()
public final void appendInstruction(Instruction inst)
public final void appendInstruction(Instruction inst, SSA ssa)
public final void removeInstruction(Instruction inst)
public final void removeInstruction(Instruction prev, Instruction inst)
public final Instruction insertInstructionAfter(Instruction after, Instruction inst)
public final void insertInstructionAtHead(Instruction inst)
public final void insertInstructionBeforeBranch(Instruction inst)
public final Instruction getFirstInstruction()
public final void setFirstInstruction(Instruction first)
public final Instruction getLastInstruction()
public final void setLastInstruction(Instruction last)
public final int getPredicate()
public final int[] getPredicates()
public final void removePredicates()
public final void setPredicate(int predicate)
public final void setPredicates(int[] predicates)
public final void setPredicate(int predicate, boolean onTrue)
public final boolean isPredicatedOnTrue()
public final boolean isPredicated()
public final void analyze(IntMap<Vector<java.lang.Integer>> targets, IntMap<java.lang.Integer> uses, BitVect mov3)
public final int estimateFanout(Instruction inst, IntMap<Vector<java.lang.Integer>> targets, IntMap<java.lang.Integer> uses, BitVect mov3)
public final int estimateNumInstructions(Instruction inst)
public final boolean isLegalBlock()
public final PredicateBlock cut(Instruction split, Trips2Generator gen)
protected void removeSpillCode()
protected void nullifyStores(BitVect nulls, SSA ssa, Trips2RegisterSet registers)
protected void removeDummyStores(SSA ssa)
public java.lang.String getDisplayName()
getDisplayName
in interface DisplayNode
getDisplayName
in class Root
public java.lang.String getDisplayLabel()
getDisplayLabel
in interface DisplayNode
getDisplayLabel
in class Root
public java.lang.String getStats()
public final java.lang.String toString()
toString
in class Root
public DColor getDisplayColorHint()
getDisplayColorHint
in interface DisplayNode
getDisplayColorHint
in class Root
DColor
public DShape getDisplayShapeHint()
getDisplayShapeHint
in interface DisplayNode
getDisplayShapeHint
in class Root
DShape
public PredicateBlock copy()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |