This is an archive of the discontinued LLVM Phabricator instance.

[SCEV] Generalize no-self-wrap check in isLoopInvariantExitCondDuringFirstIterations
ClosedPublic

Authored by mkazantsev on Nov 9 2020, 11:15 PM.

Details

Summary

Lift limitation on step being +/- 1. In fact, the only thing it is needed for
is proving no-self-wrap. We can instead check this flag directly.

Theoretically it can increase the scope of the transform, but I could not
construct such test easily.

Diff Detail

Event Timeline

mkazantsev created this revision.Nov 9 2020, 11:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 9 2020, 11:15 PM
apilipenko accepted this revision.Nov 10 2020, 7:10 PM
apilipenko added inline comments.
llvm/lib/Analysis/ScalarEvolution.cpp
9593–9595

Nit. IsStepNonNegative local variable can be removed.

This revision is now accepted and ready to land.Nov 10 2020, 7:10 PM

This was completely illegal. Need to find a way to revert it now.