changeset 5222:155f8ca28f11

Fix for peeling : fix a bug in the Virtual chain reconstruction
author Gilles Duboscq <duboscq@ssw.jku.at>
date Tue, 10 Apr 2012 15:48:54 +0200
parents d066f83db303
children e706b132f580 51d2cac7db70
files graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/loop/SuperBlock.java
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/loop/SuperBlock.java	Tue Apr 10 14:06:02 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/loop/SuperBlock.java	Tue Apr 10 15:48:54 2012 +0200
@@ -204,8 +204,12 @@
 
     private static ValueProxyNode findProxy(ValueNode value, BeginNode proxyPoint) {
         for (ValueProxyNode vpn : proxyPoint.proxies()) {
-            if (GraphUtil.unProxify(vpn) == value) {
-                return vpn;
+            ValueNode v = vpn;
+            while (v instanceof ValueProxyNode) {
+                v = ((ValueProxyNode) v).value();
+                if (v == value) {
+                    return vpn;
+                }
             }
         }
         return null;
@@ -233,7 +237,7 @@
                 ValueProxyNode inputProxy = findProxy(value, earlyExit);
                 if (inputProxy != null) {
                     ValueProxyNode newInputProxy = findProxy(newValue, newEarlyExit);
-                    assert newInputProxy != null;
+                    assert newInputProxy != null : "no proxy for " + newValue + " at " + newEarlyExit;
                     valuePhi.addInput(inputProxy);
                     valuePhi.addInput(newInputProxy);
                 } else {