[SCEV] Compute max backedge count for loops with "shift ivs"
authorSanjoy Das <sanjoy@playingwithpointers.com>
Wed, 28 Oct 2015 21:27:14 +0000 (21:27 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Wed, 28 Oct 2015 21:27:14 +0000 (21:27 +0000)
commitadc5ad1c9d51da826f1eb60656da6af86207d0b6
tree1e90400b740eeda9c50030800f79e294200c1753
parentee37e50003d1bebb189c694b7f88c377a29e242e
[SCEV] Compute max backedge count for loops with "shift ivs"

This teaches SCEV to compute //max// backedge taken counts for loops
like

    for (int i = k; i != 0; i >>>= 1)
      whatever();

SCEV yet cannot represent the exact backedge count for these loops, and
this patch does not change that.  This is really geared towards teaching
SCEV that loops like the above are *not* infinite.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251558 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/ScalarEvolution.h
lib/Analysis/ScalarEvolution.cpp
test/Analysis/ScalarEvolution/shift-op.ll [new file with mode: 0644]