[PATCH] D98222: [SCEV] Use trip count information to improve shift recurrence ranges

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 18 22:06:28 PDT 2021


mkazantsev accepted this revision.
mkazantsev added a comment.
This revision is now accepted and ready to land.

We can either name it separately (and honestly, I don't think there is a better name than shift recurrence), but please make it crystal clear in the comments that this thing *looks* very much like addrec, but there is a tricky difference that it may have a variant step. Many algorithms for AddRecs rely on invariance of arguments explicitly or implicitly. And if someone ever wants to generalize them with your new recurrencies, they will keep falling into this pithole.

Please add either

- A Loop Invariant check
- A comment highlighting that the shift value might not be an invariant

Either should be fine, but the former is more reliable.
Otherwise, looks good.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98222/new/

https://reviews.llvm.org/D98222



More information about the llvm-commits mailing list