< prev index next >
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedScaledInductionVariable.java
Print this page
rev 52509 : [mq]: graal
*** 61,77 ****
return value;
}
@Override
public Direction direction() {
Stamp stamp = scale.stamp(NodeView.DEFAULT);
if (stamp instanceof IntegerStamp) {
IntegerStamp integerStamp = (IntegerStamp) stamp;
if (integerStamp.isStrictlyPositive()) {
! return base.direction();
} else if (integerStamp.isStrictlyNegative()) {
! return base.direction().opposite();
}
}
return null;
}
--- 61,81 ----
return value;
}
@Override
public Direction direction() {
+ Direction baseDirection = base.direction();
+ if (baseDirection == null) {
+ return null;
+ }
Stamp stamp = scale.stamp(NodeView.DEFAULT);
if (stamp instanceof IntegerStamp) {
IntegerStamp integerStamp = (IntegerStamp) stamp;
if (integerStamp.isStrictlyPositive()) {
! return baseDirection;
} else if (integerStamp.isStrictlyNegative()) {
! return baseDirection.opposite();
}
}
return null;
}
< prev index next >