82 if (value instanceof SubNode && base.valueNode() == value.getY()) { 83 return -base.constantStride(); 84 } 85 return base.constantStride(); 86 } 87 88 @Override 89 public ValueNode initNode() { 90 return op(base.initNode(), offset); 91 } 92 93 @Override 94 public ValueNode strideNode() { 95 if (value instanceof SubNode && base.valueNode() == value.getY()) { 96 return graph().addOrUniqueWithInputs(NegateNode.create(base.strideNode(), NodeView.DEFAULT)); 97 } 98 return base.strideNode(); 99 } 100 101 @Override 102 public ValueNode extremumNode(boolean assumePositiveTripCount, Stamp stamp) { 103 return op(base.extremumNode(assumePositiveTripCount, stamp), IntegerConvertNode.convert(offset, stamp, graph(), NodeView.DEFAULT)); 104 } 105 106 @Override 107 public ValueNode exitValueNode() { 108 return op(base.exitValueNode(), offset); 109 } 110 111 @Override 112 public boolean isConstantExtremum() { 113 return offset.isConstant() && base.isConstantExtremum(); 114 } 115 116 @Override 117 public long constantExtremum() { 118 return op(base.constantExtremum(), offset.asJavaConstant().asLong()); 119 } 120 121 private long op(long b, long o) { 122 if (value instanceof AddNode) { 123 return b + o; | 82 if (value instanceof SubNode && base.valueNode() == value.getY()) { 83 return -base.constantStride(); 84 } 85 return base.constantStride(); 86 } 87 88 @Override 89 public ValueNode initNode() { 90 return op(base.initNode(), offset); 91 } 92 93 @Override 94 public ValueNode strideNode() { 95 if (value instanceof SubNode && base.valueNode() == value.getY()) { 96 return graph().addOrUniqueWithInputs(NegateNode.create(base.strideNode(), NodeView.DEFAULT)); 97 } 98 return base.strideNode(); 99 } 100 101 @Override 102 public ValueNode extremumNode(boolean assumeLoopEntered, Stamp stamp) { 103 return op(base.extremumNode(assumeLoopEntered, stamp), IntegerConvertNode.convert(offset, stamp, graph(), NodeView.DEFAULT)); 104 } 105 106 @Override 107 public ValueNode exitValueNode() { 108 return op(base.exitValueNode(), offset); 109 } 110 111 @Override 112 public boolean isConstantExtremum() { 113 return offset.isConstant() && base.isConstantExtremum(); 114 } 115 116 @Override 117 public long constantExtremum() { 118 return op(base.constantExtremum(), offset.asJavaConstant().asLong()); 119 } 120 121 private long op(long b, long o) { 122 if (value instanceof AddNode) { 123 return b + o; |