www.delorie.com/archives/browse.cgi   search  
Mail Archives: pgcc/2000/01/29/23:11:55

Date: Sun, 30 Jan 2000 00:01:38 -0400
From: peter AT Cordes DOT Phys DOT Dal DOT Ca
To: pgcc AT delorie DOT com
Subject: Re: pgcc and egcs alignment -- function, basic block and string
Message-ID: <20000130000138.B7075@cordes.phys.dal.ca>
References: <38921CD6 DOT 2A725779 AT ix DOT netcom DOT com> <20000129032101 DOT A25630 AT atrey DOT karlin DOT mff DOT cuni DOT cz> <38927310 DOT 2033EED4 AT ix DOT netcom DOT com> <20000130011444 DOT A32728 AT atrey DOT karlin DOT mff DOT cuni DOT cz>
Mime-Version: 1.0
X-Mailer: Mutt 0.95.4us
In-Reply-To: <20000130011444.A32728@atrey.karlin.mff.cuni.cz>; from Jan Hubicka on Sun, Jan 30, 2000 at 01:14:44AM +0100
Reply-To: pgcc AT delorie DOT com
Errors-To: dj-admin AT delorie DOT com
X-Mailing-List: pgcc AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Sun, Jan 30, 2000 at 01:14:44AM +0100, Jan Hubicka wrote:
> Yes. We was discussing this recently with Richard and we probably will change this bit.
> The rationale behind is to place string into as few cache lines as possible.
> (when the string starts near end of cache line, it may go cross one extra).
> But this  needs some tunning.

 Is it possible for gcc to look for gaps to put short strings into?  Often,
programs have some strings in the under-5-byte range, and they could be put
between two functions instead of whatever is usually used when it doesn't
have to be nops.  (I'm assuming that normally the space opened up by moving
a function along the the next alignment boundary is wasted.  I'm saying gcc
should see if there are any strings which will fit in that space.)  Any
comments on whether this is even a good idea?

 For the string optimization, it would be really good to be able to do
cross-file optimization, because then the short strings could all find
homes...  OTOH, putting a string right after the ret from a function which
uses the string, (or passes its addr to another function, which can be
assumed to use it) makes a _lot_ of sense (to me...).  Such strings should
maybe get priority over strings which are exactly the right length, but from
an unrelated file.  Since the CPU has separate insn and data caches at the
L1 level, this only helps by getting the function into the L2 cache.  That
is still a Good Thing, though.  Doing this makes it possible to align
functions to 32 bytes without wasting too much memory.

 Similarly, if you have two functions, each of which are about 1.5 cache
lines long, then does it make sense to put them back-to-back, so that their
combination uses 3 cache lines instead of 4?  Maybe it would be worth doing
if one called the other.

-- 
#define X(x,y) x##y
DUPS Secretary ; http://is2.dal.ca/~dups/
Peter Cordes ;  e-mail: X(peter AT cordes DOT phys. , dal.ca)

"The gods confound the man who first found out how to distinguish the hours!
 Confound him, too, who in this place set up a sundial, to cut and hack
 my day so wretchedly into small pieces!" -- Plautus, 200 BCE

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019