This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Some beginner's questions concerning doing instrumentation/analysis in GIMPLE
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Carter Cheng <cartercheng at gmail dot com>
- Cc: GCC Development <gcc at gcc dot gnu dot org>
- Date: Mon, 14 Jan 2019 09:35:15 +0100
- Subject: Re: Some beginner's questions concerning doing instrumentation/analysis in GIMPLE
- References: <CALS6=qUgn3DY4K2DoGhBU2gt7Uxs4jaJYJwQCr7euBnUB3720Q@mail.gmail.com>
On Thu, Jan 10, 2019 at 3:00 PM Carter Cheng <cartercheng@gmail.com> wrote:
>
> Hello,
>
> I am trying to assess an idea and whether it is possible to implement a
> certain idea as a gcc plugin. I look over some of the information on the
> web and the gcc internals documentation but I cannot still figure out some
> basic things concerning manipulating GIMPLE in a plugin.
>
> 1) How does one add and safely remove basic blocks in GIMPLE if one is
> trying to transform a function?
>
> 2) How does one label a basic block with a new label (for conditional
> branches)?
>
> 3) How does one do the same for functions (like in situations when one is
> doing interprocedural analysis and function cloning)?
>
> I apologize if this is in a tutorial somewhere but I could not find it.
Your questions are a bit broad and thus hard to answer in a short e-mail.
I suggest you look at tree-call-cdce.c which creates new control-flow
on GIMPLE.
For more specific questions please shortly elaborate on what you are
intending to do IL-wise.
Richard.
> Regards,
>
> Carter.