use of org.graalvm.compiler.core.common.type.ArithmeticOpTable.BinaryOp.Sub in project graal by oracle.
the class SubNode method canonical.
@Override
public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode forY) {
NodeView view = NodeView.from(tool);
ValueNode ret = super.canonical(tool, forX, forY);
if (ret != this) {
return ret;
}
BinaryOp<Sub> op = getOp(forX, forY);
return canonical(this, op, stamp, forX, forY, view);
}
use of org.graalvm.compiler.core.common.type.ArithmeticOpTable.BinaryOp.Sub in project graal by oracle.
the class SubNode method create.
public static ValueNode create(ValueNode x, ValueNode y, NodeView view) {
BinaryOp<Sub> op = ArithmeticOpTable.forStamp(x.stamp(view)).getSub();
Stamp stamp = op.foldStamp(x.stamp(view), y.stamp(view));
ConstantNode tryConstantFold = tryConstantFold(op, x, y, stamp, view);
if (tryConstantFold != null) {
return tryConstantFold;
}
return canonical(null, op, stamp, x, y, view);
}
Aggregations