how to get the condition from loop information with llvm classes

I want to get some condition from loop information,for example,
for(int i=0; i<COUNT; i++){}
I want to get some message such as i<COUNT, which classes can work?

COUNT is a loop trip count here. See LoopInfo.h and ScalarEvalution.h (and related SCEV interface) for more information.

I've been having the same issue as chenneng but have never encountered a non-null trip count. Apparently there are certain optimization passes [1] that have to run first. Does anyone know of some sample code for a pass that calls getTripCount? Thanks,

Trevor

[1] http://lists.cs.uiuc.edu/pipermail/llvmdev/2010-May/031568.html