use of org.graalvm.compiler.truffle.compiler.phases.inlining.AgnosticInliningPhase in project graal by oracle.
the class AgnosticInliningPhaseTest method runLanguageAgnosticInliningPhase.
protected StructuredGraph runLanguageAgnosticInliningPhase(OptimizedCallTarget callTarget) {
final PartialEvaluator partialEvaluator = getTruffleCompiler(callTarget).getPartialEvaluator();
final CompilationIdentifier compilationIdentifier = new CompilationIdentifier() {
@Override
public String toString(Verbosity verbosity) {
return "";
}
};
final PartialEvaluator.Request request = partialEvaluator.new Request(callTarget.getOptionValues(), getDebugContext(), callTarget, partialEvaluator.rootForCallTarget(callTarget), compilationIdentifier, getSpeculationLog(), new TruffleCompilerImpl.CancellableTruffleCompilationTask(new TruffleCompilationTask() {
private TruffleInliningData inlining = new TruffleInlining();
@Override
public boolean isCancelled() {
return false;
}
@Override
public boolean isLastTier() {
return true;
}
@Override
public TruffleInliningData inliningData() {
return inlining;
}
@Override
public boolean hasNextTier() {
return false;
}
}));
final AgnosticInliningPhase agnosticInliningPhase = new AgnosticInliningPhase(partialEvaluator, request);
agnosticInliningPhase.apply(request.graph, getTruffleCompiler(callTarget).getPartialEvaluator().getProviders());
return request.graph;
}
use of org.graalvm.compiler.truffle.compiler.phases.inlining.AgnosticInliningPhase in project graal by oracle.
the class PartialEvaluator method inliningGraphPE.
@SuppressWarnings({ "unused", "try" })
private void inliningGraphPE(Request request) {
boolean inlined;
try (DebugCloseable a = PartialEvaluationTimer.start(request.debug)) {
AgnosticInliningPhase inliningPhase = new AgnosticInliningPhase(this, request);
inliningPhase.apply(request.graph, providers);
if (!inliningPhase.rootIsLeaf()) {
// If we've seen a truffle call in the graph, even if we have not inlined any call
// target, we need to run the truffle tier phases again after the PE inlining phase
// has finalized the graph.
// On the other hand, if there are no calls (root is a leaf) we can skip the truffle
// tier because there are no finalization points.
truffleTier(request);
}
}
request.graph.maybeCompress();
}
Aggregations