[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
Fri Mar 12 01:01:42 PST 2021


mkazantsev added a comment.

Questiong regarding the helper you are using: looking into `matchSimpleRecurrence`, I don't really think it's doing what it seems to be doing. Consider case:
loop:

  iv = phi [start][iv.next]
  x = load volatile ...  // Loop-variant load
  iv.next = shl iv, x

  I didn't really run a test, but from the code I cannot figure why it wouldn't be recognized as a simple recurrence. I guess the loop-invariance check is missing inside this helper, not in your current patch. The logic there could also be simplified if we gave it LoopInfo with notion of latch (we wouldn't need 2 iterations in loop there). Please consider this refactoring.


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

https://reviews.llvm.org/D98222



More information about the llvm-commits mailing list