src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/NestedLoopEffectsPhaseComplexityTest.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
*** old/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/NestedLoopEffectsPhaseComplexityTest.java Fri Jul 7 09:29:45 2017
--- new/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/NestedLoopEffectsPhaseComplexityTest.java Fri Jul 7 09:29:45 2017
*** 23,39 ****
--- 23,40 ----
package org.graalvm.compiler.core.test.inlining;
import static org.graalvm.compiler.phases.common.DeadCodeEliminationPhase.Optionality.Optional;
import org.graalvm.compiler.core.test.GraalCompilerTest;
! import org.graalvm.compiler.debug.DebugContext;
import org.graalvm.compiler.debug.TTY;
import org.graalvm.compiler.graph.Node;
import org.graalvm.compiler.nodes.Invoke;
import org.graalvm.compiler.nodes.StructuredGraph;
import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions;
import org.graalvm.compiler.nodes.java.MethodCallTargetNode;
+ import org.graalvm.compiler.options.OptionValues;
import org.graalvm.compiler.phases.BasePhase;
import org.graalvm.compiler.phases.OptimisticOptimizations;
import org.graalvm.compiler.phases.PhaseSuite;
import org.graalvm.compiler.phases.common.CanonicalizerPhase;
import org.graalvm.compiler.phases.common.DeadCodeEliminationPhase;
*** 98,111 ****
--- 99,111 ----
public void inlineDirectRecursiveLoopCallNoReads() {
testAndTime("recursiveLoopMethod");
}
private void testAndTime(String snippet) {
initializeForTimeout();
for (int i = InliningCountLowerBound; i < InliningCountUpperBound; i++) {
StructuredGraph g1 = prepareGraph(snippet, i);
! StructuredGraph g2 = (StructuredGraph) g1.copy(g1.getDebug());
ResolvedJavaMethod method = g1.method();
long elapsedRE = runAndTimePhase(g1, new EarlyReadEliminationPhase(new CanonicalizerPhase()));
long elapsedPEA = runAndTimePhase(g2, new PartialEscapePhase(true, new CanonicalizerPhase(), g1.getOptions()));
if (LOG_PHASE_TIMINGS) {
TTY.printf("Needed %dms to run early partial escape analysis on a graph with %d nested loops compiling method %s\n", elapsedPEA, i, method);
*** 119,129 ****
--- 119,130 ----
private long runAndTimePhase(StructuredGraph g, BasePhase<? super PhaseContext> phase) {
HighTierContext context = getDefaultHighTierContext();
long start = System.currentTimeMillis();
phase.apply(g, context);
long end = System.currentTimeMillis();
! Debug.dump(Debug.DETAILED_LEVEL, g, "After %s", phase.contractorName());
! DebugContext debug = g.getDebug();
+ debug.dump(DebugContext.DETAILED_LEVEL, g, "After %s", phase.contractorName());
return end - start;
}
private StructuredGraph prepareGraph(String snippet, int inliningCount) {
ResolvedJavaMethod callerMethod = getResolvedJavaMethod(snippet);
*** 136,152 ****
--- 137,154 ----
ResolvedJavaMethod calleeMethod = next.callTarget().targetMethod();
for (int i = 0; i < inliningCount; i++) {
next = callerGraph.getNodes(MethodCallTargetNode.TYPE).first().invoke();
EconomicSet<Node> canonicalizeNodes = InliningUtil.inlineForCanonicalization(next, calleeGraph, false, calleeMethod);
canonicalizer.applyIncremental(callerGraph, context, canonicalizeNodes);
! Debug.dump(Debug.DETAILED_LEVEL, callerGraph, "After inlining %s into %s iteration %d", calleeMethod, callerMethod, i);
! callerGraph.getDebug().dump(DebugContext.DETAILED_LEVEL, callerGraph, "After inlining %s into %s iteration %d", calleeMethod, callerMethod, i);
}
return callerGraph;
}
- private static StructuredGraph parseBytecodes(ResolvedJavaMethod method, HighTierContext context, CanonicalizerPhase canonicalizer) {
! StructuredGraph newGraph = new StructuredGraph.Builder(getInitialOptions(), AllowAssumptions.NO).method(method).build();
! OptionValues options = getInitialOptions();
+ StructuredGraph newGraph = new StructuredGraph.Builder(options, getDebugContext(options), AllowAssumptions.NO).method(method).build();
context.getGraphBuilderSuite().apply(newGraph, context);
new DeadCodeEliminationPhase(Optional).apply(newGraph);
canonicalizer.apply(newGraph, context);
return newGraph;
}
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/NestedLoopEffectsPhaseComplexityTest.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File