# HG changeset patch # User Doug Simon # Date 1443531418 -7200 # Node ID f035cf1d2e5a33ea92bbb56e4c0214dfc61fb312 # Parent b415eaae0aa9a466ab974815d51b720306b4c447# Parent f7693dc4e3410bf2023f71f83dbdf3d25caa6a8d Merge. diff -r b415eaae0aa9 -r f035cf1d2e5a graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java --- a/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java Tue Sep 29 14:55:03 2015 +0200 +++ b/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java Tue Sep 29 14:56:58 2015 +0200 @@ -289,7 +289,7 @@ append(new LoadDataAddressOp(dst, data)); } - protected SPARCAddressValue asAddressValue(Value address) { + public SPARCAddressValue asAddressValue(Value address) { if (address instanceof SPARCAddressValue) { return (SPARCAddressValue) address; } else { diff -r b415eaae0aa9 -r f035cf1d2e5a graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PhiNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PhiNode.java Tue Sep 29 14:55:03 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PhiNode.java Tue Sep 29 14:56:58 2015 +0200 @@ -233,4 +233,12 @@ return merge() instanceof LoopBeginNode; } + public boolean hasValidInput() { + for (ValueNode n : values()) { + if (n != null) { + return true; + } + } + return false; + } } diff -r b415eaae0aa9 -r f035cf1d2e5a graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/util/GraphUtil.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/util/GraphUtil.java Tue Sep 29 14:55:03 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/util/GraphUtil.java Tue Sep 29 14:56:58 2015 +0200 @@ -164,6 +164,9 @@ if (usage.isAlive()) { if (usage instanceof PhiNode) { usage.replaceFirstInput(node, null); + if (!((PhiNode) usage).hasValidInput()) { + propagateKill(usage); + } } else { propagateKill(usage); } diff -r b415eaae0aa9 -r f035cf1d2e5a graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java Tue Sep 29 14:55:03 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java Tue Sep 29 14:56:58 2015 +0200 @@ -134,6 +134,7 @@ public class SnippetTemplate { private static final boolean EAGER_SNIPPETS = Boolean.getBoolean("graal.snippets.eager"); + private boolean mayRemoveLocation = false; /** * Holds the {@link ResolvedJavaMethod} of the snippet, together with some information about the @@ -1236,8 +1237,9 @@ if (pos.getInputType() == InputType.Memory && pos.get(usage) == node) { MemoryNode replacement = map.getLastLocationAccess(location); if (replacement == null) { - assert LocationIdentity.any().equals(location) || Arrays.stream(info.privateLocations).anyMatch(Predicate.isEqual(location)) : "Snippet " + info.method.format("%h.%n") + - " contains access to the non-private location " + location + ", but replacee doesn't access this location." + map.getLocations(); + assert mayRemoveLocation || LocationIdentity.any().equals(location) || Arrays.stream(info.privateLocations).anyMatch(Predicate.isEqual(location)) : "Snippet " + + info.method.format("%h.%n") + " contains access to the non-private location " + location + ", but replacee doesn't access this location." + + map.getLocations(); } else { pos.set(usage, replacement.asNode()); } @@ -1496,4 +1498,8 @@ } return true; } + + public void setMayRemoveLocation(boolean mayRemoveLocation) { + this.mayRemoveLocation = mayRemoveLocation; + } } diff -r b415eaae0aa9 -r f035cf1d2e5a graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/ArrayEqualsNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/ArrayEqualsNode.java Tue Sep 29 14:55:03 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/ArrayEqualsNode.java Tue Sep 29 14:56:58 2015 +0200 @@ -78,6 +78,18 @@ this.length = length; } + public ValueNode getArray1() { + return array1; + } + + public ValueNode getArray2() { + return array2; + } + + public ValueNode getLength() { + return length; + } + @Override public Node canonical(CanonicalizerTool tool) { if (tool.allUsagesAvailable() && hasNoUsages()) { diff -r b415eaae0aa9 -r f035cf1d2e5a mx.graal/suite.py