# HG changeset patch # User Thomas Wuerthinger # Date 1424133853 -3600 # Node ID d786fa19dc471c424db254100dd2deb393363ace # Parent ac5b08ea9a6aa4a07ccc4628f9a988be5c6336c2# Parent 5779b6771043be057cb2b715753319af148e5a0c Merge. diff -r ac5b08ea9a6a -r d786fa19dc47 graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopTransformations.java --- a/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopTransformations.java Tue Feb 17 01:43:24 2015 +0100 +++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopTransformations.java Tue Feb 17 01:44:13 2015 +0100 @@ -68,6 +68,8 @@ LoopFragmentWhole originalLoop = loop.whole(); StructuredGraph graph = firstNode.graph(); + loop.loopBegin().incrementUnswitches(); + // create new control split out of loop ControlSplitNode newControlSplit = (ControlSplitNode) firstNode.copyWithInputs(); originalLoop.entryPoint().replaceAtPredecessor(newControlSplit); diff -r ac5b08ea9a6a -r d786fa19dc47 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/LoopBeginNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/LoopBeginNode.java Tue Feb 17 01:43:24 2015 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/LoopBeginNode.java Tue Feb 17 01:44:13 2015 +0100 @@ -43,6 +43,8 @@ protected double loopFrequency; protected int nextEndIndex; protected int unswitches; + protected int inversionCount; + @OptionalInput(InputType.Guard) GuardingNode overflowGuard; public LoopBeginNode() { @@ -185,10 +187,18 @@ return unswitches; } - public void incUnswitches() { + public void incrementUnswitches() { unswitches++; } + public int getInversionCount() { + return inversionCount; + } + + public void setInversionCount(int count) { + inversionCount = count; + } + @Override public void simplify(SimplifierTool tool) { removeDeadPhis();