[gc-improv] Copy current trunk to branch

Paolo Bonzini bonzini@gnu.org
Thu Jan 20 10:14:00 GMT 2011


On 01/20/2011 05:18 AM, Laurynas Biveinis wrote:
> - Move RTL back to obstacks: global, per-function, scratch, maybe a
> few per-pass obstacks too. My work so far is based on Bernd Schmidt's
> patch [1]. Also this will enable quite a few cleanups: in gengtype,
> removal a lot of GTY markers in backends that only serve PCH.

Maybe we can find something better than obstacks?  There are two 
possible benefits of obstacks: space locality (i.e. hope that parts of 
an rtx are in the same cache line) and easily defined lifetimes.

If we use a different interface than obstacks for RTL allocation, we can 
try to separate the two.  For example, the primitives could be:

(1) start allocating global
(2) stop allocating global
(3) start allocating per-function
(4) discard per-function
(5) start allocating scratch
(6) discard scratch up to last call to (5)
(7) move scratch to per-function

With obstacks, (7) is not easily implemented.  The fwprop.c changes in 
Bernd's patch that emulate it, for example, are quite hard to follow and 
not very idiomatic.  A different interface could support it and at the 
same time allow us to try different backends: some examples are

- malloc

- alloc-pools

- consecutive allocation like obstacks, but allowing implementation of 
all seven items above

- GGC

My two cents,

Paolo



More information about the Gcc-patches mailing list