rohd-hcl icon indicating copy to clipboard operation
rohd-hcl copied to clipboard

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

Open mkorbel1 opened this issue 5 months ago • 1 comments

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 avatar Sep 11 '24 21:09 mkorbel1