src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/BinaryArithmeticNode.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
*** old/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/BinaryArithmeticNode.java Mon Mar 20 17:40:34 2017
--- new/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/BinaryArithmeticNode.java Mon Mar 20 17:40:34 2017
*** 100,131 ****
--- 100,131 ----
public Stamp foldStamp(Stamp stampX, Stamp stampY) {
assert stampX.isCompatible(x.stamp()) && stampY.isCompatible(y.stamp());
return getArithmeticOp().foldStamp(stampX, stampY);
}
! public static AddNode add(StructuredGraph graph, ValueNode v1, ValueNode v2) {
! return graph.unique(new AddNode(v1, v2));
! public static ValueNode add(StructuredGraph graph, ValueNode v1, ValueNode v2) {
! return graph.addOrUniqueWithInputs(AddNode.create(v1, v2));
}
! public static AddNode add(ValueNode v1, ValueNode v2) {
! return new AddNode(v1, v2);
! public static ValueNode add(ValueNode v1, ValueNode v2) {
! return AddNode.create(v1, v2);
}
! public static MulNode mul(StructuredGraph graph, ValueNode v1, ValueNode v2) {
! return graph.unique(new MulNode(v1, v2));
! public static ValueNode mul(StructuredGraph graph, ValueNode v1, ValueNode v2) {
! return graph.addOrUniqueWithInputs(MulNode.create(v1, v2));
}
! public static MulNode mul(ValueNode v1, ValueNode v2) {
! return new MulNode(v1, v2);
! public static ValueNode mul(ValueNode v1, ValueNode v2) {
! return MulNode.create(v1, v2);
}
! public static SubNode sub(StructuredGraph graph, ValueNode v1, ValueNode v2) {
! return graph.unique(new SubNode(v1, v2));
! public static ValueNode sub(StructuredGraph graph, ValueNode v1, ValueNode v2) {
! return graph.addOrUniqueWithInputs(SubNode.create(v1, v2));
}
! public static SubNode sub(ValueNode v1, ValueNode v2) {
! return new SubNode(v1, v2);
! public static ValueNode sub(ValueNode v1, ValueNode v2) {
! return SubNode.create(v1, v2);
}
private enum ReassociateMatch {
x,
y;
*** 189,199 ****
--- 189,199 ----
* +, -, *, &, | and ^
*
* @param forY
* @param forX
*/
! public static BinaryArithmeticNode<?> reassociate(BinaryArithmeticNode<?> node, NodePredicate criterion, ValueNode forX, ValueNode forY) {
! public static ValueNode reassociate(BinaryArithmeticNode<?> node, NodePredicate criterion, ValueNode forX, ValueNode forY) {
assert node.getOp(forX, forY).isAssociative();
ReassociateMatch match1 = findReassociate(node, criterion);
if (match1 == null) {
return node;
}
*** 233,243 ****
--- 233,243 ----
assert !(invertM1 && invertM2) && !(invertA && aSub);
ValueNode m1 = match1.getValue(node);
ValueNode m2 = match2.getValue(other);
ValueNode a = match2.getOtherValue(other);
if (node instanceof AddNode || node instanceof SubNode) {
! BinaryNode associated;
! ValueNode associated;
if (invertM1) {
associated = BinaryArithmeticNode.sub(m2, m1);
} else if (invertM2) {
associated = BinaryArithmeticNode.sub(m1, m2);
} else {
*** 272,282 ****
--- 272,282 ----
* @return the original node or another node with the same input ordering
*/
@SuppressWarnings("deprecation")
public BinaryNode maybeCommuteInputs() {
assert this instanceof BinaryCommutative;
! if (!y.isConstant() && (x.isConstant() || x.getId() > y.getId())) {
ValueNode tmp = x;
x = y;
y = tmp;
if (graph() != null) {
// See if this node already exists
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/BinaryArithmeticNode.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File