https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98813
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Blocks| |53947
Keywords| |missed-optimization
Ever confirmed|0 |1
Severity|normal |enhancement
CC| |rguenth at gcc dot gnu.org,
| |rsandifo at gcc dot gnu.org
Status|UNCONFIRMED |NEW
Last reconfirmed| |2021-01-25
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed. While niter analysis produces 'assumptions' there's no such
capability in SCEV analysis. In particular we have accesses like
_54 = (unsigned int) n_24(D);
...
_2 = l_m_34 + _54;
_3 = (long unsigned int) _2;
_4 = _3 * 8;
_5 = C_25(D) + _4;
_6 = *_5;
where SCEV analysis could "look through" the (long unsigned int) cast
in case _2 >= 0 && _2 <= INT_MAX / 8, it could, similar to niter analysis,
record this somewhere.
The overflow analysis there possibly also has similar issues as the
split_constant_offset_1 one (which might also benefit from tracking
'assumptions').
Btw, tracking 'assumptions' not as GENERIC tree expression but in a form
that would be nicer to collect & simplify later would be nice. Maybe
for tracking purposes just note the SSA name _4 telling it's producer
is assumed to not overflow, leaving combining & producing of versioning
conditions to other helpers.
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53947
[Bug 53947] [meta-bug] vectorizer missed-optimizations