[LLVMdev] Alternative of Loop::getTripCount?

Michael Ilseman michael at lunarg.com
Tue Jul 3 09:08:04 PDT 2012


As Ivan said, it's migrated into Scalar Evolution. I would recommend
carefully reading the new code (ScalarEvolution.h/cpp), as the
interface changed to be based on a particular exiting block and a loop
might have multiple exits. Also, what is meant by a "trip count" here
might differ by 1 from what one might think of as a trip count, as
this "trip count" is really the number of times the exiting condition
is checked. In the case of a for-loop, which checks the condition
before executing the body, it can be 1 higher than the number of times
the body is executed.

On Mon, Jul 2, 2012 at 6:18 PM, Ivan Llopard <ivanllopard at gmail.com> wrote:
> Hi Taemin,
>
> On 03/07/2012 01:53, Taemin Kim wrote:
>> I found out that Loop::getTripCount method is obsolete in LLVM 3.1
>> Is there an alternative?
>
> I use getSmallConstantTripCount() to get loop trip counts using the
> ScalarEvolution analysis pass. See
> include/llvm/Analysis/ScalarEvolution.h for a detailed explanation.
>
> Ivan
>
>>
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list