Mercurial > hg > graal-compiler
changeset 9569:c9e9ce8ce16a
Fix overflow guard condition for down counted loops
Add assert in expand logic phase
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Mon, 06 May 2013 13:03:37 +0200 |
parents | 9e77e858b6eb |
children | 314814fa0223 |
files | graal/com.oracle.graal.loop/src/com/oracle/graal/loop/CountedLoopInfo.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ExpandLogicPhase.java |
diffstat | 2 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/CountedLoopInfo.java Sat May 04 01:43:42 2013 +0200 +++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/CountedLoopInfo.java Mon May 06 13:03:37 2013 +0200 @@ -140,7 +140,7 @@ cond = graph.unique(new IntegerLessThanNode(v1, end)); } else { assert iv.direction() == Direction.Down; - IntegerArithmeticNode v1 = add(ConstantNode.forIntegerKind(kind, kind.getMinValue(), graph), add(iv.strideNode(), one)); + IntegerArithmeticNode v1 = add(ConstantNode.forIntegerKind(kind, kind.getMinValue(), graph), sub(one, iv.strideNode())); if (oneOff) { v1 = add(v1, one); }
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ExpandLogicPhase.java Sat May 04 01:43:42 2013 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ExpandLogicPhase.java Mon May 06 13:03:37 2013 +0200 @@ -34,6 +34,7 @@ for (LogicBinaryNode logic : graph.getNodes(LogicBinaryNode.class)) { processBinary(logic); } + assert graph.getNodes(LogicBinaryNode.class).isEmpty(); } private static void processBinary(LogicBinaryNode binary) {