[PATCH] Loop Rerolling Pass

Andrew Trick atrick at apple.com
Thu Oct 17 11:09:38 PDT 2013


On Oct 17, 2013, at 10:30 AM, Hal Finkel <hfinkel at anl.gov> wrote:

>> If the loop is testing less-than constant ’n’, I think we already
>> handle it (knowing n < INT_MAX-stride). I’m not sure what we do for
>> equals ’n’.
> 
> No, that does not currently work. Compiling the following with clang:
> 
> void foo(int n, int *x) {
>  for (int i = 0; i < n; i += 3) {
>    x[i] = i;
>    x[i+1] = i+1;
>    x[i+2] = i+2;
>  }
> }
> 
> I find that SE->hasLoopInvariantBackedgeTakenCount(L) returns false. From what you're saying, this sounds like a bug, no?

By “constant n” I meant “a constant” ;)
-Andy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131017/7c8273c5/attachment.html>


More information about the llvm-commits mailing list