public class DeadCodeEliminationPhase extends Phase
Modifier and Type | Class and Description |
---|---|
static class |
DeadCodeEliminationPhase.Optionality |
static class |
DeadCodeEliminationPhase.Options |
BasePhase.ApplyScope, BasePhase.BasePhaseStatistics, BasePhase.NotApplicable, BasePhase.PhaseOptions, BasePhase.SharedGlobalPhaseState
ALWAYS_APPLICABLE
Constructor and Description |
---|
DeadCodeEliminationPhase()
Creates a dead code elimination phase that will be run irrespective of
DeadCodeEliminationPhase.Options.ReduceDCE . |
DeadCodeEliminationPhase(DeadCodeEliminationPhase.Optionality optionality)
Creates a dead code elimination phase that will be run only if it is
non-optional or
DeadCodeEliminationPhase.Options.ReduceDCE is false. |
Modifier and Type | Method and Description |
---|---|
Optional<BasePhase.NotApplicable> |
canApply(GraphState graphState)
Checks if all the preconditions to
BasePhase.apply(StructuredGraph, Object, boolean) the phase
are met. |
void |
run(StructuredGraph graph) |
apply, apply, applyScope, codeSizeIncrease, contractorName, equals, getName, hashCode, mustApply, shouldDumpAfterAtBasicLevel, shouldDumpBeforeAtBasicLevel, updateGraphState
clone, getClass, notify, notifyAll, toString, wait, wait, wait
checkContract
public DeadCodeEliminationPhase()
DeadCodeEliminationPhase.Options.ReduceDCE
.public DeadCodeEliminationPhase(DeadCodeEliminationPhase.Optionality optionality)
DeadCodeEliminationPhase.Options.ReduceDCE
is false.public Optional<BasePhase.NotApplicable> canApply(GraphState graphState)
BasePhase
BasePhase.apply(StructuredGraph, Object, boolean)
the phase
are met.canApply
in class BasePhase<Object>
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.public void run(StructuredGraph graph)