Skip to content
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

Optimize Sum and Counter to avoid underflow/overflow logic when possible #90

Open
mkorbel1 opened this issue Sep 11, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@mkorbel1
Copy link
Contributor

Motivation

As a follow-on to #89

It should be possible to avoid creating logic which considers whether an overflow/underflow has occurred by determining whether it is ever possible.

For example:

  • If all interfaces are incrementing, and the initial value is not greater than the max (possible) value, then it cannot overflow
  • If all interfaces are decrementing, and the initial value is not less than the min (possible) value, then it cannot underflow

Desired solution

Conditionally generate the portions of the If.block for overflow/underflow based on analysis of the provided interfaces.

Alternatives considered

No response

Additional details

No response

@mkorbel1 mkorbel1 added the enhancement New feature or request label Sep 11, 2024
@mkorbel1
Copy link
Contributor Author

Note that as part of this, we probably need to pass maxValue and minValue directly into Sum from Counter rather than the processed Logic versions of them, so that Sum can properly infer the true maximum/minimum values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant