changeset 11347:231c8a83cf41

Samll additions to Loops api, make IntegerExactArithmeticNodes iterable
author Gilles Duboscq <duboscq@ssw.jku.at>
date Sat, 17 Aug 2013 17:52:21 +0200
parents b4009c075969
children d46159285f97
files graal/com.oracle.graal.loop/src/com/oracle/graal/loop/CountedLoopInfo.java graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopsData.java graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/arithmetic/IntegerExactArithmeticNode.java
diffstat 3 files changed, 18 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/CountedLoopInfo.java	Sat Aug 17 15:07:41 2013 +0200
+++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/CountedLoopInfo.java	Sat Aug 17 17:52:21 2013 +0200
@@ -126,6 +126,10 @@
         return iv.direction();
     }
 
+    public InductionVariable getCounter() {
+        return iv;
+    }
+
     public GuardingNode getOverFlowGuard() {
         return loop.loopBegin().getOverflowGuard();
     }
--- a/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopsData.java	Sat Aug 17 15:07:41 2013 +0200
+++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopsData.java	Sat Aug 17 17:52:21 2013 +0200
@@ -78,6 +78,18 @@
         return loops;
     }
 
+    public List<LoopEx> innerFirst() {
+        ArrayList<LoopEx> loops = new ArrayList<>(loops());
+        Collections.sort(loops, new Comparator<LoopEx>() {
+
+            @Override
+            public int compare(LoopEx o1, LoopEx o2) {
+                return o2.lirLoop().depth - o1.lirLoop().depth;
+            }
+        });
+        return loops;
+    }
+
     public Collection<LoopEx> countedLoops() {
         List<LoopEx> counted = new LinkedList<>();
         for (LoopEx loop : loops()) {
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/arithmetic/IntegerExactArithmeticNode.java	Sat Aug 17 15:07:41 2013 +0200
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/arithmetic/IntegerExactArithmeticNode.java	Sat Aug 17 17:52:21 2013 +0200
@@ -22,10 +22,11 @@
  */
 package com.oracle.graal.truffle.nodes.arithmetic;
 
+import com.oracle.graal.graph.*;
 import com.oracle.graal.nodes.*;
 import com.oracle.graal.nodes.spi.*;
 
-interface IntegerExactArithmeticNode extends Lowerable {
+interface IntegerExactArithmeticNode extends Lowerable, Node.IterableNodeType {
 
     IntegerExactArithmeticSplitNode createSplit(AbstractBeginNode next, AbstractBeginNode deopt);
 }