< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/RightShiftNode.java

Print this page
rev 52509 : [mq]: graal

*** 46,55 **** --- 46,62 ---- public RightShiftNode(ValueNode x, ValueNode y) { super(TYPE, ArithmeticOpTable::getShr, x, y); } + public static ValueNode create(ValueNode x, int y, NodeView view) { + if (y == 0) { + return x; + } + return create(x, ConstantNode.forInt(y), view); + } + public static ValueNode create(ValueNode x, ValueNode y, NodeView view) { ArithmeticOpTable.ShiftOp<Shr> op = ArithmeticOpTable.forStamp(x.stamp(view)).getShr(); Stamp stamp = op.foldStamp(x.stamp(view), (IntegerStamp) y.stamp(view)); ValueNode value = ShiftNode.canonical(op, stamp, x, y, view); if (value != null) {
< prev index next >