This is an archive of the discontinued LLVM Phabricator instance.

[NFC][SCEV] Generalize monotonicity check for full and limited iteration space
ClosedPublic

Authored by mkazantsev on Oct 29 2020, 7:17 AM.

Details

Summary

A piece of logic of isLoopInvariantExitCondDuringFirstIterations is actually
a generalized predicate monotonicity check. This patch moves it into the
corresponding method and generalizes it a bit.

Diff Detail

Event Timeline

mkazantsev created this revision.Oct 29 2020, 7:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 29 2020, 7:17 AM
mkazantsev requested review of this revision.Oct 29 2020, 7:17 AM
fhahn added a subscriber: fhahn.Oct 29 2020, 10:32 AM
mkazantsev edited the summary of this revision. (Show Details)Nov 2 2020, 9:20 PM

Can we split restructuring and generalization (possibly adding a test for the generalization part)? It's hard to assess correctness when you combine the two in one change.

mkazantsev planned changes to this revision.Nov 9 2020, 11:11 PM
apilipenko added inline comments.Nov 10 2020, 7:15 PM
llvm/lib/Analysis/ScalarEvolution.cpp
9291–9325

Maybe move ProvedNoWrap into a lambda? This way the checks can be turned into early exits which should make it easier to follow the logic.

mkazantsev retitled this revision from [SCEV] Generalize monotonicity check for full and limited iteration space to [NFC][SCEV] Generalize monotonicity check for full and limited iteration space.
mkazantsev edited the summary of this revision. (Show Details)

Now it's completely an NFC.

apilipenko accepted this revision.Nov 11 2020, 8:45 AM
This revision is now accepted and ready to land.Nov 11 2020, 8:45 AM