|Register allocation in the presence of pointers email@example.com (1990-02-22)|
|Re: Register allocation in the presence of pointers firstname.lastname@example.org (1990-02-22)|
|Date:||Thu, 22 Feb 90 10:44:07 EST|
|From:||email@example.com (Dale Worley)|
Mohd Hanafiah b. Abdullah writes:
> How does one perform register allocation on scalar variables that may
> be pointed to by others?
The usual strategy is to never leave the value of the variable in a register,
since it may be fetched or modified at any time via the pointer. On some
hardware, registers have addresses and this conservative strategy may not be
needed. A more interesting approach would be to analyze which parts of the
program might reference the variable through a pointer and which can not --
then you know in which parts of the program you have to leave the value in its
"official" location and in which parts you can leave the variable in a
register. This requires serious global data-flow analysis, which, although
possible, is rarely implemented.
Dale Worley Compass, Inc. firstname.lastname@example.org
Return to the
Search the comp.compilers archives again.