use of org.graalvm.compiler.phases.BasePhase in project graal by oracle.
the class GraalCompilerTest method getCustomGraphBuilderSuite.
protected PhaseSuite<HighTierContext> getCustomGraphBuilderSuite(GraphBuilderConfiguration gbConf) {
PhaseSuite<HighTierContext> suite = getDefaultGraphBuilderSuite();
ListIterator<BasePhase<? super HighTierContext>> iterator = suite.findPhase(GraphBuilderPhase.class);
initializeInvocationPluginExtensions();
GraphBuilderConfiguration gbConfCopy = editGraphBuilderConfiguration(gbConf.copy());
iterator.remove();
iterator.add(new GraphBuilderPhase(gbConfCopy));
return suite;
}
use of org.graalvm.compiler.phases.BasePhase in project graal by oracle.
the class AddressLoweringHotSpotSuitesProvider method createSuites.
@Override
public Suites createSuites(OptionValues options) {
Suites suites = super.createSuites(options);
ListIterator<BasePhase<? super LowTierContext>> findPhase = suites.getLowTier().findPhase(FixReadsPhase.class);
if (findPhase == null) {
findPhase = suites.getLowTier().findPhase(ExpandLogicPhase.class);
}
findPhase.add(new AddressLoweringPhase(addressLowering));
return suites;
}
use of org.graalvm.compiler.phases.BasePhase in project graal by oracle.
the class GraalCompilerTest method createSuites.
protected Suites createSuites(OptionValues opts) {
Suites ret = backend.getSuites().getDefaultSuites(opts).copy();
ListIterator<BasePhase<? super HighTierContext>> iter = ret.getHighTier().findPhase(ConvertDeoptimizeToGuardPhase.class, true);
if (iter == null) {
/*
* in the economy configuration, we don't have the ConvertDeoptimizeToGuard phase, so we
* just select the first CanonicalizerPhase in HighTier
*/
iter = ret.getHighTier().findPhase(CanonicalizerPhase.class);
}
iter.add(new Phase() {
@Override
protected void run(StructuredGraph graph) {
ComputeLoopFrequenciesClosure.compute(graph);
}
@Override
public float codeSizeIncrease() {
return NodeSize.IGNORE_SIZE_CONTRACT_FACTOR;
}
@Override
protected CharSequence getName() {
return "ComputeLoopFrequenciesPhase";
}
});
ret.getHighTier().appendPhase(new Phase() {
@Override
protected void run(StructuredGraph graph) {
assert checkHighTierGraph(graph) : "failed HighTier graph check";
}
@Override
public float codeSizeIncrease() {
return NodeSize.IGNORE_SIZE_CONTRACT_FACTOR;
}
@Override
protected CharSequence getName() {
return "CheckGraphPhase";
}
});
ret.getMidTier().appendPhase(new Phase() {
@Override
protected void run(StructuredGraph graph) {
assert checkMidTierGraph(graph) : "failed MidTier graph check";
}
@Override
public float codeSizeIncrease() {
return NodeSize.IGNORE_SIZE_CONTRACT_FACTOR;
}
@Override
protected CharSequence getName() {
return "CheckGraphPhase";
}
});
ret.getLowTier().appendPhase(new Phase() {
@Override
protected void run(StructuredGraph graph) {
assert checkLowTierGraph(graph) : "failed LowTier graph check";
}
@Override
public float codeSizeIncrease() {
return NodeSize.IGNORE_SIZE_CONTRACT_FACTOR;
}
@Override
protected CharSequence getName() {
return "CheckGraphPhase";
}
});
return ret;
}
use of org.graalvm.compiler.phases.BasePhase in project graal by oracle.
the class LoopPartialUnrollTest method createSuites.
@Override
protected Suites createSuites(OptionValues opts) {
Suites suites = super.createSuites(opts).copy();
PhaseSuite<MidTierContext> mid = suites.getMidTier();
ListIterator<BasePhase<? super MidTierContext>> iter = mid.findPhase(LoopPartialUnrollPhase.class);
BasePhase<? super MidTierContext> partialUnoll = iter.previous();
if (iter.previous().getClass() != FrameStateAssignmentPhase.class) {
// Ensure LoopPartialUnrollPhase runs immediately after FrameStateAssignment, so it gets
// priority over other optimizations in these tests.
mid.findPhase(LoopPartialUnrollPhase.class).remove();
ListIterator<BasePhase<? super MidTierContext>> fsa = mid.findPhase(FrameStateAssignmentPhase.class);
fsa.add(partialUnoll);
}
return suites;
}
Aggregations