This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Provide a pointer_map<T> template


On Wed, 19 Jun 2013, Richard Biener wrote:

> On Wed, 19 Jun 2013, Richard Biener wrote:
> 
> > 
> > This templates the pointer-map implementation (actually it copies
> > the implementation, leaving the old interface unchanged) providing
> > a templated value type.  That's suitable to replace the various
> > users requesting a pointer-to-integer-type map, like I noticed
> > for the two LTO tree recording mechanisms.  Which in turn saves
> > memory on 64bit hosts (and should be less heavy-weight on the cache).
> > Not very much, but a quarter of the old pointer-map memory usage.
> > 
> > LTO bootstrap and regtest running on x86_64-unknown-linux-gnu.
> > 
> > In theory we can typedef pointer_map<void *> pointer_map_t, but
> > that requires touching all pointer_map_t users to drop the
> > leading 'struct' and eventually include pointer-set.h.
> > 
> > I changed the insert () interface to get another output as to
> > whether the slot was present to avoid the need to have a special
> > "not present" value.  That also makes it unnecessary to zero
> > the values array.
> >
> > Any comments?
> > 
> > If not then I'll comb over existing pointer -> integer type map
> > users and convert them.
> 
> Added the dominance.c one and changed the implementation to
> "inherit" from pointer-set instead, sharing a bit more code.
> 
> The pointer-map template is also type-safe for the value array
> so converting all pointer-map users will make the code a tiny
> bit prettier.
> 
> The remaining integer type cases seem to store integer types
> as large as pointer types so they fall in the same category
> (but eventually they chose that large type for no good reason).
> 
> Old patch LTO bootstrapped and tested on x86_64-unknown-linux-gnu.
> 
> Any objections?

None and thus installed.

Richard.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]