public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* How can I build new functions on the fly during optimization?
@ 2019-09-19  2:27 Gary Oblock
  2019-09-19 10:51 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Gary Oblock @ 2019-09-19  2:27 UTC (permalink / raw)
  To: GCC Development

I'm trying to build new functions on the fly during optimization.
For those of you that have not been following my previous questions,
this is structure reorganization optimization related. For example when
somebody frees an array of type fu, I'd like to build a new
function _reorg_free_fu which does the correct things for a
transformed array of type _reorg_fu.

I've run across uses of these:
  build_fn_decl
  gimple_build_call
However, I don't see any code going any further than that.

Anybody have any ideas about how I can accomplish the rest of
what I need to do? Note, I'll be doing this during LTRANS.

Thanks,

Gary Oblock

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How can I build new functions on the fly during optimization?
  2019-09-19  2:27 How can I build new functions on the fly during optimization? Gary Oblock
@ 2019-09-19 10:51 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2019-09-19 10:51 UTC (permalink / raw)
  To: Gary Oblock; +Cc: GCC Development

On Thu, Sep 19, 2019 at 4:27 AM Gary Oblock <goblock@marvell.com> wrote:
>
> I'm trying to build new functions on the fly during optimization.
> For those of you that have not been following my previous questions,
> this is structure reorganization optimization related. For example when
> somebody frees an array of type fu, I'd like to build a new
> function _reorg_free_fu which does the correct things for a
> transformed array of type _reorg_fu.
>
> I've run across uses of these:
>   build_fn_decl
>   gimple_build_call
> However, I don't see any code going any further than that.
>
> Anybody have any ideas about how I can accomplish the rest of
> what I need to do? Note, I'll be doing this during LTRANS.

One of the few examples is cgraph_node::expand_thunk
where it builds a GIMPLE thunk.  The other is in ipa.c,
cgraph_build_static_cdtor_1 but using a GENERIC body.

Most others do sth like cloning an existing function or
moving part of the CFG to a new function.

Richard.

> Thanks,
>
> Gary Oblock

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-19 10:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-19  2:27 How can I build new functions on the fly during optimization? Gary Oblock
2019-09-19 10:51 ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).