[PATCH] Loop Rerolling Pass
Andrew Trick
atrick at apple.com
Wed Oct 16 18:33:40 PDT 2013
On Oct 16, 2013, at 6:25 PM, Andrew Trick <atrick at apple.com> wrote:
>> But it seems, that being the case, we could still return 'n/5' for loops with only one exiting block? I thought that is what SE->hasLoopInvariantBackedgeTakenCount(L) was for. It would only say that there was a backedge-taken count if the loop structure was simple enough that there was one unambiguous answer. Is this just an implementation oversight, or are there additional complications?
>>
>>>
>>> So you could get a minimum taken count for a particular loop back
>>> edge in this case if we adapt the SCEV API to communicate properly.
>>
>> I recall discussing this before, and so I apologize, but can you elaborate on what 'communicate properly' will entail?
>
> I’m open to anything. For each branch exit we could distinguish between a min vs. exact backedge taken count.
Minimum taken count is the wrong term. We have either an “exact-may-exit” count or an “exact-must-exit” count. The implication of exact-may-exit is that either:
- the loop exits at this iteration
- the loop exits at a later iteration via another exit
- the loop terminates at a later iteration
- the loop exhibits undefined behavior (at a later iteration)
Of course, in either case, the loop may exit earlier via another exit or terminate early.
-Andy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131016/77fd3eb5/attachment.html>
More information about the llvm-commits
mailing list