[LLVMdev] scev questions

Eugene Toder eltoder at gmail.com
Thu Aug 22 16:00:36 PDT 2013


On Thu, Aug 22, 2013 at 6:40 PM, Nick Lewycky <nlewycky at google.com> wrote:

> It's a known limitation, see ScalarEvolution.cpp:5568.
>
> The fundamental problem is that len in your example could be (unsigned)
> -1, -2 or -3, in which case your loop is infinite.
>

Unless I'm missing something, if len is -1 (or otherwise less than 0) the
loop has 0 trip count. Did you mean INT_MAX-1, INT_MAX-2 etc? In this case,
I believe, the behavior is undefined, because adds are marked with "nsw".

Eugene
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130822/74d2c0f9/attachment.html>


More information about the llvm-dev mailing list