OpenJDK / graal / graal-jvmci-8
changeset 2986:ed63c8695fad
Fix LoopCounter merging
author | Gilles Duboscq <gilles.duboscq@oracle.com> |
---|---|
date | Wed, 15 Jun 2011 21:13:52 +0200 |
parents | ce38e01aa596 |
children | a8e8035916a3 |
files | graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/LoopPhase.java |
diffstat | 1 files changed, 7 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/LoopPhase.java Wed Jun 15 19:55:14 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/LoopPhase.java Wed Jun 15 21:13:52 2011 +0200 @@ -27,6 +27,7 @@ import com.oracle.max.graal.compiler.ir.*; import com.oracle.max.graal.compiler.value.*; import com.oracle.max.graal.graph.*; +import com.sun.cri.ci.*; public class LoopPhase extends Phase { @@ -59,13 +60,15 @@ LoopCounter c2 = acounters[j]; if (c2 != null && c1.stride().valueEqual(c2.stride())) { acounters[j] = null; - IntegerSub sub = new IntegerSub(c1.kind, c2.init(), c1.init(), graph); - IntegerAdd add = new IntegerAdd(c1.kind, c1, sub, graph); - Phi phi = new Phi(c1.kind, loopBegin, graph); // TODO (gd) assumes order on loppBegin preds + CiKind kind = c1.kind; + IntegerSub sub = new IntegerSub(kind, c2.init(), c1.init(), graph); + IntegerAdd addStride = new IntegerAdd(kind, sub, c1.stride(), graph); + IntegerAdd add = new IntegerAdd(kind, c1, addStride, graph); + Phi phi = new Phi(kind, loopBegin, graph); // TODO (gd) assumes order on loopBegin preds phi.addInput(c2.init()); phi.addInput(add); c2.replace(phi); - System.out.println("--> merged Loop Counters"); + //System.out.println("--> merged Loop Counters"); } } }