Skip to content

Commit

Permalink
[GR-59871] Expose overflow API.
Browse files Browse the repository at this point in the history
PullRequest: graal/19344
  • Loading branch information
davleopo committed Nov 27, 2024
2 parents 015a8f7 + 422f244 commit 8fccd4d
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,11 @@ public boolean counterNeverOverflows() {
if (loop.loopBegin().canNeverOverflow()) {
return true;
}
if (!isLimitIncluded && getLimitCheckedIV().isConstantStride() && Loop.absStrideIsOne(getLimitCheckedIV())) {
return ivCanNeverOverflow(getLimitCheckedIV());
}

public boolean ivCanNeverOverflow(InductionVariable iv) {
if (!isLimitIncluded && iv.isConstantStride() && Loop.absStrideIsOne(iv)) {
return true;
}
if (loop.loopBegin().isProtectedNonOverflowingUnsigned()) {
Expand Down Expand Up @@ -670,7 +674,7 @@ public boolean counterNeverOverflows() {
*/
// @formatter:on
IntegerStamp endStamp = (IntegerStamp) getTripCountLimit().stamp(NodeView.DEFAULT);
ValueNode strideNode = getLimitCheckedIV().strideNode();
ValueNode strideNode = iv.strideNode();
IntegerStamp strideStamp = (IntegerStamp) strideNode.stamp(NodeView.DEFAULT);
IntegerHelper integerHelper = getCounterIntegerHelper();
if (getDirection() == InductionVariable.Direction.Up) {
Expand Down

0 comments on commit 8fccd4d

Please sign in to comment.