Skip to content

Commit

Permalink
Add incremental canonicalizer around remove value proxy phase. Add co…
Browse files Browse the repository at this point in the history
…unter for peeled loops.
  • Loading branch information
thomaswue committed Oct 19, 2019
1 parent 714ce2b commit 7e7e8ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public MidTier(OptionValues options) {
appendPhase(new VerifyHeapAtReturnPhase());
}

appendPhase(new RemoveValueProxyPhase());
appendPhase(new IncrementalCanonicalizerPhase<>(canonicalizer, new RemoveValueProxyPhase()));

appendPhase(new LoweringPhase(canonicalizer, LoweringTool.StandardLoweringStage.MID_TIER));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
*/
package org.graalvm.compiler.loop.phases;

import org.graalvm.compiler.debug.CounterKey;
import org.graalvm.compiler.debug.DebugContext;
import org.graalvm.compiler.loop.LoopEx;
import org.graalvm.compiler.loop.LoopPolicies;
Expand All @@ -33,6 +34,8 @@

public class LoopPeelingPhase extends LoopPhase<LoopPolicies> {

public static final CounterKey PEELED = DebugContext.counter("Peeled");

public LoopPeelingPhase(LoopPolicies policies) {
super(policies);
}
Expand All @@ -48,6 +51,7 @@ protected void run(StructuredGraph graph, CoreProviders context) {
if (loop.canDuplicateLoop() && loop.loopBegin().getLoopEndCount() > 0) {
if (LoopPolicies.Options.PeelALot.getValue(graph.getOptions()) || getPolicies().shouldPeel(loop, data.getCFG(), context.getMetaAccess())) {
debug.log("Peeling %s", loop);
PEELED.add(debug, 1);
LoopTransformations.peel(loop);
debug.dump(DebugContext.DETAILED_LEVEL, graph, "Peeling %s", loop);
}
Expand Down

0 comments on commit 7e7e8ee

Please sign in to comment.