Alternative of Loop::getTripCount?

I found out that Loop::getTripCount method is obsolete in LLVM 3.1
Is there an alternative?

Hi Taemin,

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

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.