public final class SSIUtil extends Object
LIRInstruction
s. Instead, they are implemented as
parallel copy that spans across a control-flow edge.
The variables introduced by φ/σ of a specific block are
attached to the StandardOp.LabelOp
of the block. The outgoing
values from the predecessor are input to the
StandardOp.BlockEndOp
of the predecessor.
When it does not matter whether we are talking about a φ or a σ we call the values that
are defined by a label incoming and the values that are
input to the StandardOp.BlockEndOp
of the predecessor outgoing.
StandardOp.BlockEndOp
and StandardOp.LabelOp
are equivalent to the live-out and
live-in set of the corresponding block.
As a side effect variables are local to a block. We reuse the name of the predecessor if they
represent the same value (i.e. not a real φ definition).
B0 -> B1 ... v0|i = ... JUMP ~[v0|i, int[0|0x0]] destination: B0 -> B1 ________________________________________________ B2 -> B1 ... v1|i = ... v2|i = ... JUMP ~[v1|i, v2|i] destination: B2 -> B1 ________________________________________________ B1 <- B0,B2 [v3|i, v4|i] = LABEL ...Note: the outgoing values of a block can contain constants (see
B0
).
B0 -> B1,B2 ... v0|i = ... v1|i = ... v2|i = ... TEST (x: v1|i, y: v1|i) BRANCH ~[v2|i, v0|j] condition: <, true: B1 false: B2 ________________________________________________ B1 <- B0 [-, v0|j] = LABEL ... ________________________________________________ B2 <- B0 [v2|i, v0|j] = LABEL ...Note: If a incoming value is not needed in a branch it is
ignored
(see
B1).
-
-
Constructor Summary
Constructors
Constructor and Description
SSIUtil()
-
Method Summary
All Methods Static Methods Concrete Methods
Modifier and Type
Method and Description
static void
forEachRegisterHint(LIR lir,
AbstractBlockBase<?> block,
StandardOp.LabelOp label,
Value targetValue,
LIRInstruction.OperandMode mode,
ValueConsumer valueConsumer)
static void
forEachValuePair(LIR lir,
AbstractBlockBase<?> toBlock,
AbstractBlockBase<?> fromBlock,
SSAUtil.PhiValueVisitor visitor)
Visits each SIGMA/PHI value pair of an edge, i.e.
static StandardOp.LabelOp
incoming(LIR lir,
AbstractBlockBase<?> block)
private static LIRInstruction
incomingInst(LIR lir,
AbstractBlockBase<?> block)
private static int
indexOfValue(StandardOp.LabelOp label,
Value value)
static StandardOp.BlockEndOp
outgoing(LIR lir,
AbstractBlockBase<?> block)
static LIRInstruction
outgoingInst(LIR lir,
AbstractBlockBase<?> block)
static void
removeIncoming(LIR lir,
AbstractBlockBase<?> block)
static void
removeOutgoing(LIR lir,
AbstractBlockBase<?> block)
-
-
Constructor Detail
-
SSIUtil
public SSIUtil()
-
Method Detail
-
outgoing
public static StandardOp.BlockEndOp outgoing(LIR lir,
AbstractBlockBase<?> block)
-
outgoingInst
public static LIRInstruction outgoingInst(LIR lir,
AbstractBlockBase<?> block)
-
incoming
public static StandardOp.LabelOp incoming(LIR lir,
AbstractBlockBase<?> block)
-
incomingInst
private static LIRInstruction incomingInst(LIR lir,
AbstractBlockBase<?> block)
-
removeIncoming
public static void removeIncoming(LIR lir,
AbstractBlockBase<?> block)
-
removeOutgoing
public static void removeOutgoing(LIR lir,
AbstractBlockBase<?> block)
-
forEachValuePair
public static void forEachValuePair(LIR lir,
AbstractBlockBase<?> toBlock,
AbstractBlockBase<?> fromBlock,
SSAUtil.PhiValueVisitor visitor)
Visits each SIGMA/PHI value pair of an edge, i.e. the outgoing value from the predecessor and
the incoming value to the merge block.
-
forEachRegisterHint
public static void forEachRegisterHint(LIR lir,
AbstractBlockBase<?> block,
StandardOp.LabelOp label,
Value targetValue,
LIRInstruction.OperandMode mode,
ValueConsumer valueConsumer)
-
indexOfValue
private static int indexOfValue(StandardOp.LabelOp label,
Value value)