Skip to content

Conversation

@MathiasVP
Copy link
Contributor

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.

@github-actions github-actions bot added the Java label Jan 9, 2026
@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
@MathiasVP MathiasVP added the C++ label Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant