From: | George Neuner <gneuner2@comcast.net> |
Newsgroups: | comp.compilers |
Date: | Wed, 02 Nov 2011 12:38:56 -0400 |
Organization: | A noiseless patient Spider |
References: | 11-10-019 11-11-004 11-11-005 |
Keywords: | optimize |
Posted-Date: | 02 Nov 2011 22:43:37 EDT |
On Tue, 1 Nov 2011 22:35:04 +0000 (UTC), glen herrmannsfeldt
<gah@ugcs.caltech.edu> wrote:
>George Neuner <gneuner2@comcast.net> wrote:
>
>(big snip on optimization and register loads)
>
>> You might be asking "if the value already is in a register, why not
>> just use it rather than load a second register?" The answer to that
>> likely is a scheduling issue which depends on the use of the first
>> register. You have to remember that many CPUs can execute multiple
>> instructions in parallel, and those parallel instruction streams may
>> be executed out of order with respect to a program listing.
>
>That is what register renaming is for. Usually using more than
>the architecturally specified number of registers, the CPU
>internally remaps the registers such that it can keep one value
>in a register while an instruction is being executed out of order.
Yes. But the compiler can't count on register renaming ... it can see
only the architectural named registers. If the code in question had
copied Rx-> Ry then renaming would have been possible, but instead the
code performed a constant load to each register. No possibility of
rename sharing there.
George
Return to the
comp.compilers page.
Search the
comp.compilers archives again.