We already apply loop-guards when computing the maximum with unitary
steps. This extends the code to also do so when dealing with non-unitary
steps.
This allows us to infer a tighter maximum in some cases.
Differential D102267
[SCEV] Apply guards to max with non-unitary steps. fhahn on May 11 2021, 11:42 AM. Authored by
Details We already apply loop-guards when computing the maximum with unitary This allows us to infer a tighter maximum in some cases.
Diff Detail
Unit Tests
Event Timeline
Comment Actions Add test where applying guards pessimizes range (96c1fa2a041d), replace assert with conditional assignment.
Comment Actions LGTM
|
Is there any particular reason to believe that this assertion can't be hit? The unit step case takes the minimum and has a test for this (@guard_pessimizes_analysis). Or is the assert here so we can find a test case?
On a related note, I wonder if we shouldn't be limiting the guard insertion to comparisons against constants. That case should be non-pessimizing, and at least none of the existing tests benefit from non-constant guards.