Skip to content

Improve pattern matching range check in ArrayBoundsCheck optimizations #74944

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 4, 2024

Conversation

meg-gupta
Copy link
Contributor

Current pattern matching misses when range checks are of the form:

%cond = %end < %start
cond_fail %cond, "Range requires lowerBound <= upperBound"

instead of

%cond =  (%start <= %end) ^ 1
cond_fail %cond, "Range requires lowerBound <= upperBound"

This PR adds this pattern.

Current pattern matching misses when range checks are of the form:

%cond = %end < %start
cond_fail %cond, "Range requires lowerBound <= upperBound"

instead of
%cond =  (%start <= %end) ^ 1
cond_fail %cond, "Range requires lowerBound <= upperBound"
@meg-gupta meg-gupta requested review from atrick and eeckstein July 3, 2024 17:45
@meg-gupta
Copy link
Contributor Author

@swift-ci test

Copy link
Contributor

@eeckstein eeckstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@meg-gupta meg-gupta merged commit 2d3d670 into swiftlang:main Jul 4, 2024
5 checks passed
@meg-gupta meg-gupta deleted the abcedgecase branch July 10, 2024 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants