chenneng5758
2010-Nov-14 09:08 UTC
[LLVMdev] 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? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101114/39b8670f/attachment.html>
Devang Patel
2010-Nov-15 18:35 UTC
[LLVMdev] how to get the condition from loop information with llvm classes
On Nov 14, 2010, at 1:08 AM, chenneng5758 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. - Devang> > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101115/dfb3b67f/attachment.html>
Trevor Harmon
2010-Nov-15 21:45 UTC
[LLVMdev] how to get the condition from loop information with llvm classes
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