[llvm] r193015 - SCEV should use NSW to get trip count for positive nonunit stride loops.

Chris Lattner clattner at apple.com
Sun Oct 20 21:04:31 PDT 2013


On Oct 18, 2013, at 4:43 PM, Andrew Trick <atrick at apple.com> wrote:

> Author: atrick
> Date: Fri Oct 18 18:43:53 2013
> New Revision: 193015
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=193015&view=rev
> Log:
> SCEV should use NSW to get trip count for positive nonunit stride loops.

Great!

> 
> The most probable reason that we never optimized this before is that
> we were being careful to handle case where the developer expected a
> side-effect free infinite loop relying on overflow:

I'm not 100% sure, but I think that the reason is simpler: since NSW was introduced, I think that no one got around to implementing this.  I don't think it was intentionally excluded.   If it is straight-forward, it would be great to handle negative strides as well.

-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131020/4352401d/attachment.html>


More information about the llvm-commits mailing list