[llvm-commits] [llvm] r49928 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp

Dale Johannesen dalej at apple.com
Sat Apr 19 18:41:44 PDT 2008


On Apr 19, 2008, at 6:38 PM, Chris Lattner wrote:
> On Apr 19, 2008, at 6:22 PM, Dale Johannesen wrote:
>>>> If you continue with the thread you see Nick has that concern also.
>>>> It is true that the SCEV expression isn't right in that case if the
>>>> loop is never supposed to be executed, but so far every case I've
>>>> seen
>>>> has a guard test outside the loop proper, so I believe everything
>>>> works (the test I checked in exercises this case).
>>>
>>> This may be true for while/for loops, but isn't true for do+while
>>> loops.
>>>
>>> do {
>>> ...
>>> } while (cond);
>>>
>>> Has no dominating check.
>>
>> But those are not executed 0 times, so the failing case can't arise.
>> It works in practice, too.
>
> The count is for the number of times the backedge is executed, not the
> number of times the loop is executed, right?

The current code works in the case where the backedge is executed 0  
times.  I believe it always works.  I will change my mind if somebody  
constructs a case that doesn't work.




More information about the llvm-commits mailing list