public class CanonicalizerPhase extends BasePhase<CoreProviders>
Modifier and Type | Class and Description |
---|---|
static class |
CanonicalizerPhase.CanonicalizerFeature
Constants for types of canonicalization that can be performed.
|
static interface |
CanonicalizerPhase.CustomSimplification |
protected class |
CanonicalizerPhase.Tool |
BasePhase.ApplyScope, BasePhase.BasePhaseStatistics, BasePhase.NotApplicable, BasePhase.PhaseOptions, BasePhase.SharedGlobalPhaseState
Modifier and Type | Field and Description |
---|---|
protected CanonicalizerPhase.CustomSimplification |
customSimplification |
protected EnumSet<CanonicalizerPhase.CanonicalizerFeature> |
features |
protected static int |
MAX_ITERATION_PER_NODE |
ALWAYS_APPLICABLE
Modifier | Constructor and Description |
---|---|
protected |
CanonicalizerPhase() |
protected |
CanonicalizerPhase(CanonicalizerPhase.CustomSimplification customSimplification) |
protected |
CanonicalizerPhase(CanonicalizerPhase.CustomSimplification customSimplification,
EnumSet<CanonicalizerPhase.CanonicalizerFeature> features) |
protected |
CanonicalizerPhase(EnumSet<CanonicalizerPhase.CanonicalizerFeature> features) |
apply, apply, applyScope, codeSizeIncrease, contractorName, getName, shouldDumpAfterAtBasicLevel, shouldDumpBeforeAtBasicLevel
protected static final int MAX_ITERATION_PER_NODE
protected final EnumSet<CanonicalizerPhase.CanonicalizerFeature> features
protected final CanonicalizerPhase.CustomSimplification customSimplification
protected CanonicalizerPhase(EnumSet<CanonicalizerPhase.CanonicalizerFeature> features)
protected CanonicalizerPhase()
protected CanonicalizerPhase(CanonicalizerPhase.CustomSimplification customSimplification)
protected CanonicalizerPhase(CanonicalizerPhase.CustomSimplification customSimplification, EnumSet<CanonicalizerPhase.CanonicalizerFeature> features)
public CanonicalizerPhase copyWithCustomSimplification(CanonicalizerPhase.CustomSimplification newSimplification)
public CanonicalizerPhase copyWithoutGVN()
public CanonicalizerPhase copyWithoutSimplification()
public static CanonicalizerPhase create()
public static CanonicalizerPhase createWithoutReadCanonicalization()
public static CanonicalizerPhase createWithoutGVN()
public static CanonicalizerPhase createWithoutCFGSimplification()
public boolean checkContract()
protected boolean isFinalCanonicalizationPhase()
public boolean mustApply(GraphState graphState)
BasePhase
StructuredGraph
to be correct.mustApply
in class BasePhase<CoreProviders>
graphState
- represents the state of the StructuredGraph
used for compilation
and contains the required stages
that help in determining if a phase must be applied.public Optional<BasePhase.NotApplicable> canApply(GraphState graphState)
BasePhase
BasePhase.apply(StructuredGraph, Object, boolean)
the phase
are met.canApply
in class BasePhase<CoreProviders>
graphState
- represents the state of the StructuredGraph
used for compilation
and contains the required information to determine if a phase can be applied.Optional.empty()
if all the checks pass, Optional#of(NotApplicable)
containing why this phase is not applicable on this graphState
otherwise.protected void run(StructuredGraph graph, CoreProviders context)
run
in class BasePhase<CoreProviders>
public void updateGraphState(GraphState graphState)
BasePhase
GraphState
caused by
BasePhase.apply(StructuredGraph, Object, boolean)
.updateGraphState
in class BasePhase<CoreProviders>
graphState
- represents the state of the StructuredGraph
used for compilation.public void applyIncremental(StructuredGraph graph, CoreProviders context, Graph.Mark newNodesMark)
newNodesMark
- only the new nodes specified by this
mark are processedpublic void applyIncremental(StructuredGraph graph, CoreProviders context, Iterable<? extends Node> workingSet)
workingSet
- the initial working set of nodes on which the canonicalizer works, should
be an auto-grow node bitmappublic int hashCode()
BasePhase
PhaseInfo
annotation is introduced (c.f. NodeInfo
). The hash code returned
needs to be stable across VM executions.hashCode
in class BasePhase<CoreProviders>
public boolean equals(Object obj)
equals
in class BasePhase<CoreProviders>
BasePhase.hashCode()
protected int processWorkSet(StructuredGraph graph, CanonicalizerPhase.Tool tool)
public boolean tryGlobalValueNumbering(Node node, NodeClass<?> nodeClass, CanonicalizerPhase.Tool tool)
public boolean tryCanonicalize(Node node, NodeClass<?> nodeClass, CanonicalizerPhase.Tool tool)
public boolean getCanonicalizeReads()