This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Share int_cst nodes
- From: Andrew Haley <aph at redhat dot com>
- To: Nathan Sidwell <nathan at codesourcery dot com>
- Cc: Mark Mitchell <mark at codesourcery dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 18 Aug 2004 10:37:28 +0100
- Subject: [PATCH] Share int_cst nodes
- References: <412320DE.7020004@codesourcery.com>
Nathan Sidwell writes:
> Hi,
> This patch implements sharing of small INTEGER_CST nodes. Measurement
> has shown improvement on a large (preprocessed) c++ file. Allocated
> memory was reduced by 1MB (~3%) and compilation time improved by ~1.5%.
> I have not tuned the size of the integer cache, earlier measurements shows
> that the sweetspot is probably in the range 32..128.
>
> The cache is implemented by hanging a TREE_VEC off the TYPE_VALUES field
> of integer & pointer types. This was only used for TYPE_ORIG_SIZE_TYPE,
> and that information is now placed in the TREE_TYPE of this new TREE_VEC.
> I added a TYPE_CACHED_VALUES_P flag, so other places know to clear the
> cache when copying a type.
>
> I've inverted java's RADIX10 flag, so that more nodes can be shared there.
No objection from me.
Andrew.