Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Shared: Improve range analysis for phis at loop exits #21135

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

Draft
MathiasVP wants to merge 3 commits into github:main
base: main
Choose a base branch
Loading
from MathiasVP:better-range-analysis-for-phis

Conversation

@MathiasVP
Copy link
Contributor

@MathiasVP MathiasVP commented Jan 9, 2026

This adds support for inferring that i <= size once the loop exits in situations such as:

unsigned i = 0;
while(i < size) {
 i++;
}
use(i);

As @aschackmull noted this conclusion is only valid when we know that size >= 0 so for now it's restricted to the case where we can infer this constraint through the type of size. Ideally, this should be generalized later.

@MathiasVP MathiasVP changed the title (削除) Better range analysis for phis (削除ここまで) (追記) Shared: Better range analysis for phis (追記ここまで) Jan 9, 2026
@MathiasVP MathiasVP changed the title (削除) Shared: Better range analysis for phis (削除ここまで) (追記) Shared: Improve range analysis for phis at loop exits (追記ここまで) Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot Awaiting requested review from Copilot Copilot will automatically review once the pull request is marked ready for review

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /