[LLVMdev] how to get the condition from loop information with llvm classes

Trevor Harmon Trevor.W.Harmon at nasa.gov
Mon Nov 15 13:45:08 PST 2010


On Nov 15, 2010, at 10:35 AM, Devang Patel wrote:

>> 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




More information about the llvm-dev mailing list