Commit Graph

5 Commits

Author SHA1 Message Date
Philip Reames ea12c2cb9c [SCEV] Move mustprogress based no-self-wrap logic so it applies to all exit conditions
This change moves logic which we'd added specifically for less than tests so that it applies to equalities and greater than tests as well. The basic idea is that if we can show an IV cycles infinitely through the same series on self-wrap, and that the exit condition must be taken to prevent UB, we can conclude that it must be taken before self-wrap and thus infer said flag.

The motivation here is simple loops with unsigned induction variables w/non-one steps and inequality tests. A toy example would be:
for (unsigned i = 0; i != N; i += 2) { body; }

If body contains no side effects, and this is a mustprogress function, we can assume that this must be a finite loop and thus that the exit count is N/2.

Differential Revision: https://reviews.llvm.org/D103991
2021-11-18 10:07:44 -08:00
Philip Reames 100df68496 [SCEV] Add test coverage for invertible functions of IVs 2021-11-18 08:56:45 -08:00
Philip Reames 0623f52a46 Autogen a test for ease of update 2021-11-17 17:20:57 -08:00
Arthur Eubanks d896f22fda [test] Cleanup legacy PM tests in llvm/test/Analyis/ScalarEvolution 2021-09-04 15:57:30 -07:00
Philip Reames 4ac3dae57f [tests] Precommit test for D103991 2021-06-09 15:05:54 -07:00