use of org.graalvm.compiler.phases.common.LoweringPhase in project graal by oracle.
the class PoorMansEATest method test.
@SuppressWarnings("try")
private void test(final String snippet) {
DebugContext debug = getDebugContext();
try (DebugContext.Scope s = debug.scope("PoorMansEATest", new DebugDumpScope(snippet))) {
StructuredGraph graph = parseEager(snippet, AllowAssumptions.NO);
HighTierContext highTierContext = getDefaultHighTierContext();
new InliningPhase(new CanonicalizerPhase()).apply(graph, highTierContext);
PhaseContext context = new PhaseContext(getProviders());
new LoweringPhase(new CanonicalizerPhase(), LoweringTool.StandardLoweringStage.HIGH_TIER).apply(graph, context);
// remove framestates in order to trigger the simplification.
cleanup: for (FrameState fs : graph.getNodes(FrameState.TYPE).snapshot()) {
for (Node input : fs.inputs()) {
if (input instanceof NewInstanceNode) {
fs.replaceAtUsages(null);
fs.safeDelete();
continue cleanup;
}
}
}
new CanonicalizerPhase().apply(graph, context);
} catch (Throwable e) {
throw debug.handle(e);
}
}
Aggregations