private static final class RedundantMoveElimination.Optimization extends Object
Modifier and Type | Field and Description |
---|---|
(package private) Map<AbstractBlockBase<?>,RedundantMoveElimination.BlockData> |
blockData |
(package private) Register[] |
callerSaveRegs |
private static int |
COMPLEXITY_LIMIT
The maximum number of locations * blocks.
|
(package private) int[] |
eligibleRegs
Contains the register number for registers which can be optimized and -1 for the others.
|
private FrameMap |
frameMap |
(package private) static int |
INIT_VALUE |
(package private) int |
numRegs |
(package private) Map<Integer,Integer> |
stackIndices
|
Constructor and Description |
---|
Optimization(FrameMap frameMap) |
Modifier and Type | Method and Description |
---|---|
private static void |
clearValues(int[] state,
int defNum) |
private static void |
clearValuesOfKindObject(int[] state,
int defNum) |
private static void |
copyState(int[] dest,
int[] source) |
private void |
doOptimize(LIR lir)
The main method doing the elimination of redundant moves.
|
private void |
eliminateMoves(LIR lir)
Deletes all move instructions where the target location already contains the source
value.
|
private static int |
encodeValueNum(int valueNum,
boolean isObjectKind)
Encodes a value number + the is-object information to a number to be stored in a state.
|
private int |
getOffset(StackSlot stackSlot) |
private int |
getStateIdx(Value location)
Returns the index to the state arrays in BlockData for a specific location.
|
private void |
initBlockData(LIR lir) |
private static boolean |
isEligibleMove(LIRInstruction op)
Returns true for a move instruction which is a candidate for elimination.
|
private static boolean |
isObjectValue(int encodedValueNum)
Returns true if an encoded value number (which is stored in a state) refers to an object
reference.
|
private static boolean |
mergeState(int[] dest,
int[] source,
int defNum)
The state merge function for dataflow joins.
|
private boolean |
solveDataFlow(LIR lir)
Calculates the entry and exit states for all basic blocks.
|
private int |
updateState(int[] state,
LIRInstruction op,
int initValueNum)
Updates the state for one instruction.
|
Map<AbstractBlockBase<?>,RedundantMoveElimination.BlockData> blockData
Register[] callerSaveRegs
int[] eligibleRegs
Map<Integer,Integer> stackIndices
int numRegs
static final int INIT_VALUE
private static final int COMPLEXITY_LIMIT
mergeState(int[], int[], int)
(assuming a small number of iterations in solveDataFlow(com.oracle.graal.lir.LIR)
.public Optimization(FrameMap frameMap)
private void doOptimize(LIR lir)
private void initBlockData(LIR lir)
private boolean solveDataFlow(LIR lir)
private void eliminateMoves(LIR lir)
private int updateState(int[] state, LIRInstruction op, int initValueNum)
private static boolean mergeState(int[] dest, int[] source, int defNum)
private static void copyState(int[] dest, int[] source)
private static void clearValues(int[] state, int defNum)
private static void clearValuesOfKindObject(int[] state, int defNum)
private int getStateIdx(Value location)
private static int encodeValueNum(int valueNum, boolean isObjectKind)
private static boolean isObjectValue(int encodedValueNum)
private static boolean isEligibleMove(LIRInstruction op)