|memory operands and Register allocation email@example.com (shrey) (2008-02-21)|
|Re: memory operands and Register allocation DrDiettrich1@aol.com (Hans-Peter Diettrich) (2008-02-24)|
|From:||Hans-Peter Diettrich <DrDiettrich1@aol.com>|
|Date:||Sun, 24 Feb 2008 09:27:05 +0100|
|Posted-Date:||24 Feb 2008 12:25:54 EST|
> Traditional RA algorithms are designed to provide a register for
> every operand. But some architectures can access memory directly.
> So instead of add ra, rb, rc -> add memloc1, memloc2, memloc3.
That's okay for one operation, no need to optimize further. When more
operations are involved, intermediate results better should reside in
> Is there any work on how to extend some of traditional algorithms to
> provide for this possibility ?
I'm not sure about algorithms. The costs of using registers vs. memory
are different, and it's only agreed that the cost of memory access is
higher than register access. Now it depends on the actual
(architectural) weights, whether it's cheaper to use an memory operand
instead of reserving a register for it. IMO an optimization problem of
higher order, e.g. linear programming, Simplex algorithm...
Another practical way may be a transformation of the register based
solution into final mixed mode code. Or a quick look at the number of
available registers will show, that for CISC machines (like x86) a
traditional register allocation optimization will be of little use.
Return to the
Search the comp.compilers archives again.