[LLVMdev] [LLVMDev] Number of loops in a region

Josh Klontz josh.klontz at gmail.com
Sat Jan 3 14:09:49 PST 2015


Simone,

While not a complete solution, I believe the LoopInfo analysis pass will
get you part of the way there.

-Josh

On Fri, Jan 2, 2015 at 7:14 PM, Simone Atzeni <simone.at at gmail.com> wrote:

> Hi,
>
> I was wondering if there is a way to count the number of loops contained
> in a region.
>
> For example in a program like this:
>
> ----------------------------------------------------
>   for (int i = 1; i < MAX; ++i) {
>     x[i] = x[i - 1];
>   }
>
>   for (int i = 0; i < MAX; ++i) {
>     y[i] = y[i] + 1;
>   }
>
>   fun();
>
>   for (int i = 0; i < MAX; ++i) {
>     x[i] = x[i] + 1;
>   }
> ----------------------------------------------------
>
> in my understanding the regions would be 2, the first one with the first 2
> loops and the second one with the last loop.
>
> Is it also possible to get a region with one loop at time?
>
> Thanks.
> Best,
> Simone
> _______________________________________________
> 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/20150103/9b127634/attachment.html>


More information about the llvm-dev mailing list