use of org.graalvm.compiler.core.common.type.ArithmeticOpTable.UnaryOp.Neg in project graal by oracle.
the class NegateNode method findSynonym.
protected static ValueNode findSynonym(ValueNode forValue, NodeView view) {
ArithmeticOpTable.UnaryOp<Neg> negOp = ArithmeticOpTable.forStamp(forValue.stamp(view)).getNeg();
ValueNode synonym = UnaryArithmeticNode.findSynonym(forValue, negOp);
if (synonym != null) {
return synonym;
}
if (forValue instanceof NegateNode) {
return ((NegateNode) forValue).getValue();
}
if (forValue instanceof SubNode && !(forValue.stamp(view) instanceof FloatStamp)) {
SubNode sub = (SubNode) forValue;
return SubNode.create(sub.getY(), sub.getX(), view);
}
return null;
}
Aggregations