src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopEx.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Cdiff src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopEx.java

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopEx.java

Print this page

        

*** 27,37 **** import java.util.Queue; import org.graalvm.compiler.core.common.calc.Condition; import org.graalvm.compiler.core.common.cfg.Loop; import org.graalvm.compiler.core.common.type.IntegerStamp; ! import org.graalvm.compiler.debug.Debug; import org.graalvm.compiler.debug.GraalError; import org.graalvm.compiler.graph.Node; import org.graalvm.compiler.graph.NodeBitMap; import org.graalvm.compiler.graph.iterators.NodePredicate; import org.graalvm.compiler.loop.InductionVariable.Direction; --- 27,37 ---- import java.util.Queue; import org.graalvm.compiler.core.common.calc.Condition; import org.graalvm.compiler.core.common.cfg.Loop; import org.graalvm.compiler.core.common.type.IntegerStamp; ! import org.graalvm.compiler.debug.DebugContext; import org.graalvm.compiler.debug.GraalError; import org.graalvm.compiler.graph.Node; import org.graalvm.compiler.graph.NodeBitMap; import org.graalvm.compiler.graph.iterators.NodePredicate; import org.graalvm.compiler.loop.InductionVariable.Direction;
*** 44,54 **** import org.graalvm.compiler.nodes.FrameState; import org.graalvm.compiler.nodes.FullInfopointNode; import org.graalvm.compiler.nodes.IfNode; import org.graalvm.compiler.nodes.LogicNode; import org.graalvm.compiler.nodes.LoopBeginNode; - import org.graalvm.compiler.nodes.LoopExitNode; import org.graalvm.compiler.nodes.PhiNode; import org.graalvm.compiler.nodes.PiNode; import org.graalvm.compiler.nodes.StructuredGraph; import org.graalvm.compiler.nodes.ValueNode; import org.graalvm.compiler.nodes.ValuePhiNode; --- 44,53 ----
*** 178,189 **** if (!binary.isAssociative()) { continue; } ValueNode result = BinaryArithmeticNode.reassociate(binary, invariant, binary.getX(), binary.getY()); if (result != binary) { ! if (Debug.isLogEnabled()) { ! Debug.log("%s : Reassociated %s into %s", graph.method().format("%H::%n"), binary, result); } if (!result.isAlive()) { assert !result.isDeleted(); result = graph.addOrUniqueWithInputs(result); } --- 177,189 ---- if (!binary.isAssociative()) { continue; } ValueNode result = BinaryArithmeticNode.reassociate(binary, invariant, binary.getX(), binary.getY()); if (result != binary) { ! DebugContext debug = graph.getDebug(); ! if (debug.isLogEnabled()) { ! debug.log("%s : Reassociated %s into %s", graph.method().format("%H::%n"), binary, result); } if (!result.isAlive()) { assert !result.isDeleted(); result = graph.addOrUniqueWithInputs(result); }
*** 209,219 **** negated = true; } LogicNode ifTest = ifNode.condition(); if (!(ifTest instanceof IntegerLessThanNode) && !(ifTest instanceof IntegerEqualsNode)) { if (ifTest instanceof IntegerBelowNode) { ! Debug.log("Ignored potential Counted loop at %s with |<|", loopBegin); } return false; } CompareNode lessThan = (CompareNode) ifTest; Condition condition = null; --- 209,219 ---- negated = true; } LogicNode ifTest = ifNode.condition(); if (!(ifTest instanceof IntegerLessThanNode) && !(ifTest instanceof IntegerEqualsNode)) { if (ifTest instanceof IntegerBelowNode) { ! ifTest.getDebug().log("Ignored potential Counted loop at %s with |<|", loopBegin); } return false; } CompareNode lessThan = (CompareNode) ifTest; Condition condition = null;
*** 284,294 **** } break; default: throw GraalError.shouldNotReachHere(); } ! counted = new CountedLoopInfo(this, iv, limit, oneOff, negated ? ifNode.falseSuccessor() : ifNode.trueSuccessor()); return true; } return false; } --- 284,294 ---- } break; default: throw GraalError.shouldNotReachHere(); } ! counted = new CountedLoopInfo(this, iv, ifNode, limit, oneOff, negated ? ifNode.falseSuccessor() : ifNode.trueSuccessor()); return true; } return false; }
*** 296,314 **** return data; } public void nodesInLoopBranch(NodeBitMap branchNodes, AbstractBeginNode branch) { EconomicSet<AbstractBeginNode> blocks = EconomicSet.create(); ! Collection<LoopExitNode> exits = new LinkedList<>(); Queue<Block> work = new LinkedList<>(); ControlFlowGraph cfg = loopsData().getCFG(); work.add(cfg.blockFor(branch)); while (!work.isEmpty()) { Block b = work.remove(); if (loop().getExits().contains(b)) { assert !exits.contains(b.getBeginNode()); ! exits.add((LoopExitNode) b.getBeginNode()); } else if (blocks.add(b.getBeginNode())) { Block d = b.getDominatedSibling(); while (d != null) { if (loop.getBlocks().contains(d)) { work.add(d); --- 296,314 ---- return data; } public void nodesInLoopBranch(NodeBitMap branchNodes, AbstractBeginNode branch) { EconomicSet<AbstractBeginNode> blocks = EconomicSet.create(); ! Collection<AbstractBeginNode> exits = new LinkedList<>(); Queue<Block> work = new LinkedList<>(); ControlFlowGraph cfg = loopsData().getCFG(); work.add(cfg.blockFor(branch)); while (!work.isEmpty()) { Block b = work.remove(); if (loop().getExits().contains(b)) { assert !exits.contains(b.getBeginNode()); ! exits.add(b.getBeginNode()); } else if (blocks.add(b.getBeginNode())) { Block d = b.getDominatedSibling(); while (d != null) { if (loop.getBlocks().contains(d)) { work.add(d);
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopEx.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File