From: Markus Trippelsdorf <markus@trippelsdorf.de>
To: David Malcolm <dmalcolm@redhat.com>
Cc: gcc@gcc.gnu.org
Subject: Re: [PATCH] gcc 8: Implement -felide-function-bodies
Date: Sat, 01 Apr 2017 05:56:00 -0000 [thread overview]
Message-ID: <20170401055638.GA297@x4> (raw)
In-Reply-To: <1491022848-22632-1-git-send-email-dmalcolm@redhat.com>
On 2017.04.01 at 01:00 -0400, David Malcolm wrote:
> The following patch implements a new function-body-elision
> optimization, which can dramatically improve performance,
> especially under certain benchmarks.
>
> gcc/ChangeLog:
> * common.opt (felide-function-bodies): New option.
> * gimplify.c (gimplify_body): Implement function-body
> elision.
>
> diff --git a/gcc/common.opt b/gcc/common.opt
> index 4021622..a32a56d 100644
> --- a/gcc/common.opt
> +++ b/gcc/common.opt
> @@ -1299,6 +1299,10 @@ fipa-sra
> Common Report Var(flag_ipa_sra) Init(0) Optimization
> Perform interprocedural reduction of aggregates.
>
> +felide-function-bodies
> +Common Optimization Var(flag_elide_function_bodies)
> +Perform function body elision optimization
> +
> feliminate-unused-debug-symbols
> Common Report Var(flag_debug_only_used_symbols)
> Perform unused symbol elimination in debug info.
> diff --git a/gcc/gimplify.c b/gcc/gimplify.c
> index fbf136f..4853953 100644
> --- a/gcc/gimplify.c
> +++ b/gcc/gimplify.c
> @@ -12390,6 +12390,9 @@ gimplify_body (tree fndecl, bool do_parms)
> the body so that DECL_VALUE_EXPR gets processed correctly. */
> parm_stmts = do_parms ? gimplify_parameters () : NULL;
>
> + if (flag_elide_function_bodies)
> + DECL_SAVED_TREE (fndecl) = NULL_TREE;
> +
> /* Gimplify the function's body. */
> seq = NULL;
> gimplify_stmt (&DECL_SAVED_TREE (fndecl), &seq);
Haha, your option also has dramatic binary size saving effects.
I would suggest to enable it unconditionally on every April Fools' Day.
--
Markus
next prev parent reply other threads:[~2017-04-01 5:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-01 4:30 David Malcolm
2017-04-01 5:56 ` Markus Trippelsdorf [this message]
2017-04-01 16:33 ` Gerald Pfeifer
2017-04-01 22:07 ` David Malcolm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170401055638.GA297@x4 \
--to=markus@trippelsdorf.de \
--cc=dmalcolm@redhat.com \
--cc=gcc@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).