# HG changeset patch # User Thomas Wuerthinger # Date 1367064119 -7200 # Node ID 50a81e6eddbc7d9be5f0cf2a7f6ebcbcadf1b286 # Parent f14413a91e1287fa2e849eb0fd69a08a340431c8 Improve opportunities for intermediate materialization ifs. diff -r f14413a91e12 -r 50a81e6eddbc graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IfNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IfNode.java Sat Apr 27 11:41:48 2013 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IfNode.java Sat Apr 27 14:01:59 2013 +0200 @@ -22,6 +22,7 @@ */ package com.oracle.graal.nodes; +import java.io.*; import java.util.*; import com.oracle.graal.api.meta.*; @@ -146,16 +147,21 @@ tool.deleteBranch(falseSuccessor()); tool.addToWorkList(trueSuccessor()); ((StructuredGraph) graph()).removeSplit(this, trueSuccessor()); + return; } else { tool.deleteBranch(trueSuccessor()); tool.addToWorkList(falseSuccessor()); ((StructuredGraph) graph()).removeSplit(this, falseSuccessor()); + return; } } else if (trueSuccessor().guards().isEmpty() && falseSuccessor().guards().isEmpty()) { - if (!removeOrMaterializeIf(tool)) { - removeIntermediateMaterialization(tool); + if (removeOrMaterializeIf(tool)) { + return; } } + if (removeIntermediateMaterialization(tool)) { + return; + } } /** @@ -173,7 +179,7 @@ if (!phis.hasNext()) { // empty if construct with no phis: remove it removeEmptyIf(tool); - return false; + return true; } else { PhiNode singlePhi = phis.next(); if (!phis.hasNext()) {