[llvm-commits] [llvm] r73866 - in /llvm/trunk: include/llvm/Analysis/ScalarEvolution.h lib/Analysis/ScalarEvolution.cpp test/Analysis/ScalarEvolution/trip-count5.ll

Dan Gohman gohman at apple.com
Mon Jun 22 14:24:20 PDT 2009


On Jun 22, 2009, at 12:54 AM, Duncan Sands wrote:


> Hi Dan,
>
>
>> Teach ScalarEvolution how to analyze loops with multiple exit
>>
>> blocks, and also exit blocks with multiple conditions (combined
>>
>> with (bitwise) ands and ors). It's often infeasible to compute an
>>
>> exact trip count in such cases, but a useful upper bound can often
>>
>> be found.
>>
>
> thanks for doing this.  Does the loop unroller make any use of it?
> The loop in PR2624 is still not unrolled for example.

I believe LLVM's current loop unroller only works if an
exact trip count is known. If ScalarEvolution finds the
trip count is either 1 or 2, the loop won't be unrolled.

There is more work to be done in ScalarEvolution to
analyze loops like the one in that testcase also.

>
>
>> +      // We couldn't compute an exact value for this exit, so
>>
>> +      // we don't be able to compute an exact value for the loop.
>>
>
> we don't -> we won't
>
> This occurs again later.


Fixed, thanks.

Dan




More information about the llvm-commits mailing list