public static interface Canonicalizable.BinaryCommutative<T extends Node> extends Canonicalizable.Binary<T>
Canonicalizable.Binary
is for nodes with two inputs where the
operation is commutative. It is used to improve GVN by trying to merge nodes with the same
inputs in different order.Canonicalizable.Binary<T extends Node>, Canonicalizable.BinaryCommutative<T extends Node>, Canonicalizable.Unary<T extends Node>
Modifier and Type | Method and Description |
---|---|
Node |
maybeCommuteInputs()
Ensure a canonical ordering of inputs for commutative nodes to improve GVN results.
|
canonical, canonical, getX, getY
Node maybeCommuteInputs()
Node.id
and call Graph.findDuplicate(Node)
on
the node if it's currently in a graph. It's assumed that if there was a constant on the
left it's been moved to the right by other code and that ordering is left alone.