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: New Optimization: Partitioning hot & cold basic blocks


> Ah, you mean enabling this cross-section thingy for leaf functions?
> Perhaps.  I seriously doubt there are leaf functions with spots cold
> enough to warrent moving.  Usually the bits you want to move are 
> error reporting or recovery, and those involve function calls.

I actually have some code (as in, I wrote it several years ago
but haven't come around to finish off the application yet because
I got distracted fixing the compiler...) which has leaf functions
with cold spots.  It uses ref counts on various data structures, and
they all got an 8-bit ref count field in the same place so you
can usually copy a value without knowing what it is.
Thus, even floats have this eight-bit refcount fields, even though
they tend not to be shared much.  But strings have a refcount highpart,
since they tend to be shared quite a lot.
Now, when some code deals with a specific item of data, it will
often handle a ref-count overflow inline, e.g. when it is just
an increment of a refcount highpart.


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