LoopBlock

public final class LoopBlock extends Block

Special control-flow block for loops. One LoopBlock represents the whole loop, and not only its header. LoopBlock’s are found in the “topBlocks” field of the FlowGraph, and in the “inside” field of LoopBlock’s. These LoopBlocks are linked by the FGArrows between their “inside” Block’s, and using the originInLevel and destinationInLevel of these FGArrows, one stays inside the same loop level.

Fields

cycleArrows

public TapList<FGArrow> cycleArrows

All FGArrow’s that cycle in this loop, to its HeaderBlock.

entryArrows

protected TapList<FGArrow> entryArrows

The list of all FGArrows that leave some Block outside the LoopBlock to some Block inside the LoopBlock.

entryBlocks

public TapList<Block> entryBlocks

All loop-entry blocks of this loop.

exitArrows

public TapList<FGArrow> exitArrows

The list of all FGArrows that leave some Block inside the LoopBlock to some Block outside the LoopBlock.

exitBlocks

public TapList<Block> exitBlocks

All loop-exit blocks of this loop.

inside

public TapList<Block> inside

The list of BasicBlock’s, LoopBlock’s and HeaderBlock’s immediately enclosed in this loop level.

isFixedPoint

public boolean isFixedPoint

Marker set to true during differentiation, to indicate this is a fixed-point loop.

Constructors

LoopBlock

public LoopBlock(TapList<Block> inside)

Creation, with the list of the immediate inside Blocks.

Methods

backFlow

public TapList<FGArrow> backFlow()
Returns

the list of all FGArrows that leave some Block outside the LoopBlock to some Block inside the LoopBlock.

cite

public void cite()

Prints a short reference to this LoopBlock onto TapEnv.curOutputStream().

enclosingLoopBlocks

protected TapList<LoopBlock> enclosingLoopBlocks()

The list of the LoopBlock’s of all enclosing loops, from the innermost loops to the outermost.

flow

public TapList<FGArrow> flow()
Returns

the list of all FGArrows that leave some Block inside the LoopBlock to some Block outside the LoopBlock.

setEnclosingLoopBlocks

protected void setEnclosingLoopBlocks(TapList<LoopBlock> enclosingLoopBlocks)

staticIterationLength

public Integer staticIterationLength()

if this loop has a number of iterations that is a static value or bounded by a static value, and therefore can easily use static tape instead of stack tape,

Returns

an Integer with this static value, otherwise returns null.

staticNormalizedIndex

public Tree staticNormalizedIndex()

toString

public String toString()