public class ReadEliminationPhase extends EffectsPhase<CoreProviders>
int i = object.fieldValue; // code not changing object.fieldValue but using i consume(object.fieldValue);Read elimination will transform this piece of code to the code below and remove the second, unnecessary, memory read of the field:
int i = object.fieldValue; // code not changing object.fieldValue but using i consume(i);
EffectsPhase.Closure<T>BasePhase.ApplyScope, BasePhase.BasePhaseStatistics, BasePhase.PhaseOptions, BasePhase.SharedGlobalPhaseState| Modifier and Type | Field and Description |
|---|---|
protected boolean |
considerGuards |
canonicalizer| Constructor and Description |
|---|
ReadEliminationPhase(CanonicalizerPhase canonicalizer) |
ReadEliminationPhase(CanonicalizerPhase canonicalizer,
boolean considerGuards) |
| Modifier and Type | Method and Description |
|---|---|
float |
codeSizeIncrease()
Returns a factor
>=1 that determines what the final code size in terms of the sum of
the node code sizes NodeSize of all nodes is. |
protected EffectsPhase.Closure<?> |
createEffectsClosure(CoreProviders context,
StructuredGraph.ScheduleResult schedule,
ControlFlowGraph cfg) |
protected void |
run(StructuredGraph graph,
CoreProviders context) |
postIteration, runAnalysisapply, apply, applyScope, contractorName, equals, getName, hashCode, shouldDumpAfterAtBasicLevel, shouldDumpBeforeAtBasicLevelclone, getClass, notify, notifyAll, toString, wait, wait, waitcheckContractpublic ReadEliminationPhase(CanonicalizerPhase canonicalizer)
public ReadEliminationPhase(CanonicalizerPhase canonicalizer, boolean considerGuards)
protected void run(StructuredGraph graph, CoreProviders context)
run in class EffectsPhase<CoreProviders>protected EffectsPhase.Closure<?> createEffectsClosure(CoreProviders context, StructuredGraph.ScheduleResult schedule, ControlFlowGraph cfg)
createEffectsClosure in class EffectsPhase<CoreProviders>public float codeSizeIncrease()
PhaseSizeContract>=1 that determines what the final code size in terms of the sum of
the node code sizes NodeSize of all nodes is.codeSizeIncrease in interface PhaseSizeContractcodeSizeIncrease in class BasePhase<CoreProviders>