Re: Register allocation

lindahl@pbm.com (Greg Lindahl)
21 Jul 2003 21:40:57 -0400

          From comp.compilers

Related articles
Register allocation sumesh_uk@hotmail.com (2003-07-04)
Re: Register allocation touati@prism.uvsq.fr (TOUATI Sid) (2003-07-15)
Register allocation robert.thorpe@antenova.com (Rob Thorpe) (2003-07-21)
Re: Register allocation sumesh_uk@hotmail.com (2003-07-21)
Re: Register allocation lindahl@pbm.com (2003-07-21)
Re: Register allocation dany42NOSPAM@free.fr (Dan) (2003-07-21)
Re: Register allocation sumesh_uk@hotmail.com (2003-07-31)
Register allocation avizit@gmail.com (2004-07-15)
Re: Register allocation gopi@sankhya.com (2004-07-28)
Re: Register allocation rajaram@acmet.com (Rajaram) (2004-08-04)
Re: Register allocation kamalp@acm.org (2004-08-05)
[24 later articles]
| List of all articles for this month |
From: lindahl@pbm.com (Greg Lindahl)
Newsgroups: comp.compilers
Date: 21 Jul 2003 21:40:57 -0400
Organization: a guest of Shadow Island Games
References: 03-07-058 03-07-097
Keywords: registers
Posted-Date: 21 Jul 2003 21:40:56 EDT
X-Newsgroups: comp.compilers

> As far as I know GCC compiles on a per file basis at present. So it
> can't make decisions like placing globals into registers. It's not a
> particularly useful optimization anyway, unless there are many
> registers.


Several modern compilers (not including, at least yet, gcc), implement
interprocedural optimization. This can amount to whole-program
optimization with lots of inlining, which may result in hot variables
being placed in registers over a bunch of routines.


You are correct that putting a variable into a register for all of a
program is rarely a win, compared to putting it in a register for only
part of the program.


-- greg


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.