Re: Register allocation

kamalp@acm.org (Kamal R. Prasad)
5 Aug 2004 14:19:21 -0400

          From comp.compilers

Related articles
[4 earlier articles]
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)
Re: Register allocation kym@sdf.lonestar.org (russell kym horsell) (2004-08-09)
Re: Register allocation kamalp@acm.org (2004-08-09)
Re: Register allocation gopi@sankhya.com (2004-08-10)
Re: Register allocation anton@mips.complang.tuwien.ac.at (2004-08-10)
Re: Register allocation anton@mips.complang.tuwien.ac.at (2004-08-10)
Re: Register allocation kym@kymhorsell.com (2004-08-11)
[18 later articles]
| List of all articles for this month |
From: kamalp@acm.org (Kamal R. Prasad)
Newsgroups: comp.compilers
Date: 5 Aug 2004 14:19:21 -0400
Organization: http://groups.google.com
References: 04-07-044 04-07-074
Keywords: registers, architecture
Posted-Date: 05 Aug 2004 14:19:21 EDT

gopi@sankhya.com (Gopi Bulusu) wrote in message news:04-07-074...
> > I am trying to get the performance estimates of a C program. But at
> > the moment I am ignoring the act that the number of registers are
> > limited. I am assuming that the processor has infinite registers. What
> > I would like to know is what range of error I might run into under
> > such assumption.
>
> Let's assume that the processor has only 1-register. Then every use of
> a virtual register in your "infinite register set" will need spill
> code to be generated which is an overhead of approximately 1-store and
> 1-load for every register access. That's the theoretical worst case
> (actual can be worse. I spent a total of only 30-seconds on this one,
> so any corrections are welcome :-)
>


The overhead is 1-load and 1-store, but the overhead isn't as high as
you would expect, thanks to a hierarchy of caches to speed things up.
No doubt the speed with which a register can be accessed is much
higher than a first-level cache access, but the performance difference
between a good and bad allocation strategy may not amount to a lot
[and that is a guess].


regards
-kamal


Post a followup to this message

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