From: Richard Guenther <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH][4.4] Add a global DECL_UID -> tree mapping
Date: Fri, 22 Feb 2008 13:51:00 -0000 [thread overview]
Message-ID: <Pine.LNX.4.64.0802221415050.5150@zhemvz.fhfr.qr> (raw)
In-Reply-To: <Pine.LNX.4.64.0711091532070.4164@zhemvz.fhfr.qr>
On Fri, 9 Nov 2007, Richard Guenther wrote:
> This patch adds a global map to look up a decl from its uid. At the
> moment all places doing this use the referenced_vars () hashtables which
> exist per function and only during a part of the compilation.
>
> This patch enables making these hashtables bitmaps which allows to
> do unused vars removal more efficient and makes walking referenced vars
> order independed of the hashtable size (the walk is now sorted after
> UID). See the followup patch.
I am going to go forward with this (and the followup) early next week.
http://gcc.gnu.org/ml/gcc-patches/2007-11/msg00524.html
This will make referenced_vars a bitmap which allows stable traversal
and fixes most of the bootstrap-debug fails if we re-enable
remove_unused_vars before final inlining.
> Bootstrapped and tested on x86_64-unknown-linux-gnu.
>
> For tramp3d the global hashtable peaks at 1M entries which makes its
> cost 8MB on a x86_64 architecture.
>
> FYI, I was just sitting on this patch for a while now.
>
> You can also see the single problem:
>
> + /* We should never try to re-insert a decl with the same uid.
> + ??? The C++ frontend breaks this invariant. Hopefully in a
> + non-fatal way, so just overwrite the slot in this case. */
> + #if 0
> + gcc_assert (!*slot);
> + #endif
>
> so the C++ frontend does something "interesting" here, which still
> needs investigation (and fixing).
I will not do this though, but file a PR instead and let the C++ FE
maintainers sort this out.
Constructive complaints welcome; if this is in I am going to
tackle the unexpanded_vars list next, which if made a bitmap will
allow us getting rid of TREE_CHAIN of (hopefully all) decls.
If we do the same for BLOCK_VARS we can get rid of remove_unused_vars
pass and let GC do its work instead. (remove_unused_vars takes quite
some compile-time on tramp3d, which of course overall pays back)
Thanks,
Richard.
next prev parent reply other threads:[~2008-02-22 13:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-09 15:03 Richard Guenther
2008-02-22 13:51 ` Richard Guenther [this message]
2008-02-22 19:16 ` Andrew MacLeod
2008-02-23 0:31 ` Diego Novillo
2008-02-23 12:51 ` Richard Guenther
2008-02-25 16:10 ` Richard Guenther
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=Pine.LNX.4.64.0802221415050.5150@zhemvz.fhfr.qr \
--to=rguenther@suse.de \
--cc=gcc-patches@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).