Outline loop body to newly created function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

In order to better study the internals of GCC, I've been writing several plugins
which read the code structure and output various information. For the past few
months, I've been trying to create a plugin for the latest GCC release (version
10.1.0) which will take a loop body, move it to a newly created function and
replace it with a call to said function. Specifically, it would convert the
following C-like piece of code at GIMPLE level without using OMP constructions:


for (i=0; i<N; i++)
    A[i] += f(i);


to this:


for (i=0; i<N; i++)
    outlined_body (A, i);

outlined_body (int *A, int i)
{
    A[i] += f(i);
}

I presume the best pass after which to register my plugin is "ssa". I have been
looking at tree-parloops.c and omp-expand.c on how to do it. However, due to my
inexperience and lack of knowledge, I can't seem to grasp all the details of
those two passes and repurpose them.

Are there any resources which could point me in the right direction other than
the wiki and GCC internals documentation (which aren't very detailed on the
topics I need) or has anyone done this before? Could anyone spare the time and
help me understand how to do it and how everything works?

Any help is greatly appreciated.

Evgenii G.




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux