This is an archive of the discontinued LLVM Phabricator instance.

[SCEV] Allow non-overflowing binops when analyzing SCC
AbandonedPublic

Authored by mkazantsev on Oct 15 2021, 4:23 AM.

Details

Summary

First step of Phi SCC processing was proving that the range of phi-translated
set of external inputs is the union of these inputs.

As the 2nd step, we also allow nuw+nsw binary operations to be included into
the SCC. For such SCCs, not only Phi translation, but also arithmetics is possible,
so we cannot just say its range is union of inputs. However, both Phi translation
and nuw+nsw arithmetic operation preserve the following invariant:
"If all external inputs into this SCC were non-negative, the SCC itself is also non-negative".

In practice, it is very useful to prove range of chunked Phis, what is shown in tests.

Diff Detail

Event Timeline

mkazantsev created this revision.Oct 15 2021, 4:23 AM
mkazantsev requested review of this revision.Oct 15 2021, 4:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 15 2021, 4:23 AM
mkazantsev added inline comments.
llvm/test/Analysis/ScalarEvolution/shift-recurrences.ll
449

This is some weird caching effect; I need to see if we can tackle this. Doesn't look too bad though.

mkazantsev planned changes to this revision.Feb 17 2022, 3:04 AM

Needs rebase.

mkazantsev abandoned this revision.Mar 4 2022, 12:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 4 2022, 12:20 AM