changeset 21095:9212e6b75c07

Small clean-up in LoopEx
author Gilles Duboscq <gilles.m.duboscq@oracle.com>
date Wed, 22 Apr 2015 16:45:33 +0200
parents 56668f0816f7
children 71e05c3a1e12
files graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopEx.java
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopEx.java	Thu Apr 23 13:37:27 2015 +0200
+++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopEx.java	Wed Apr 22 16:45:33 2015 +0200
@@ -45,7 +45,7 @@
     private final Loop<Block> loop;
     private LoopFragmentInside inside;
     private LoopFragmentWhole whole;
-    private CountedLoopInfo counted; // TODO (gd) detect
+    private CountedLoopInfo counted;
     private LoopsData data;
     private Map<Node, InductionVariable> ivs;
 
@@ -198,9 +198,6 @@
                     limit = lessThan.getY();
                 }
             }
-            if (iv != null && iv.isConstantStride() && iv.constantStride() != 1 && !(ifTest instanceof IntegerLessThanNode)) {
-                return false;
-            }
             if (condition == null) {
                 return false;
             }
@@ -212,6 +209,9 @@
                 case EQ:
                     return false;
                 case NE: {
+                    if (!iv.isConstantStride() || Math.abs(iv.constantStride()) != 1) {
+                        return false;
+                    }
                     IntegerStamp initStamp = (IntegerStamp) iv.initNode().stamp();
                     IntegerStamp limitStamp = (IntegerStamp) limit.stamp();
                     if (iv.direction() == Direction.Up) {