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

Simone Atzeni simone.at at gmail.com
Fri Jan 2 16:14:16 PST 2015


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



More information about the llvm-dev mailing list