Register optimizations

ArielMars@aol.com
Thu, 2 Mar 1995 19:40:07 GMT

          From comp.compilers

Related articles
Register optimizations ArielMars@aol.com (1995-03-02)
Re: Register optimizations mercier@news.cinenet.net (1995-03-05)
Re: Register optimizations baynes@ukpsshp1.serigate.philips.nl (1995-03-08)
Re: Register optimizations torbenm@diku.dk (1995-03-09)
Re: Register optimizations preston@tera.com (1995-03-12)
Re: Register optimizations anton@mips.complang.tuwien.ac.at (1995-03-16)
Re: Register optimizations conway@munta.cs.mu.OZ.AU (1995-03-18)
| List of all articles for this month |

Newsgroups: comp.compilers
From: ArielMars@aol.com
Keywords: registers, optimize, question
Organization: Compilers Central
Date: Thu, 2 Mar 1995 19:40:07 GMT

I've been looking at a number of methods of using registers to speed up
expression execution. It seems that great use could be made of registers,
especially on RISC machines with lots of them available.


Perhaps some of you with some experience could help me answer this one. As
compared to a system in which all local variables are held on the stack,
and where a single register is used to store the current value being
operated on and intermediate expression results are pushed on the stack,
is it more efficient to:


1) remap commonly used variables into registers, just use the one register
for expressions, and use stack space for intermediate values; or,


2) leave the local variables on the stack, and use registers for all
intermediate expression values?


The problem I see with approach #1 is that it can't be used for any
variable that could ever be referenced by address; the register obviously
has no address, and thus that variable would have to be left in main
memory. However #2 seems like it wouldn't be as effective an optimization,
as loading a value from a register offset is slower than a simple push/pop.


Or, is there some other, better approach I haven't yet run across?
Suggestions welcome, and thank you for your time.


-MarsSaxMan
Red Planet Software
--


Post a followup to this message

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