Re: How to eliminate redundant constant move instructions

glen herrmannsfeldt <gah@ugcs.caltech.edu>
Fri, 4 Nov 2011 21:19:14 +0000 (UTC)

          From comp.compilers

Related articles
[8 earlier articles]
Re: How to eliminate redundant constant move instructions amker.cheng@gmail.com (amker) (2011-11-01)
Re: How to eliminate redundant constant move instructions gneuner2@comcast.net (George Neuner) (2011-11-02)
Re: How to eliminate redundant constant move instructions acolvin@efunct.com (mac) (2011-11-03)
Re: How to eliminate redundant constant move instructions kaz@kylheku.com (Kaz Kylheku) (2011-11-03)
Re: How to eliminate redundant constant move instructions gah@ugcs.caltech.edu (glen herrmannsfeldt) (2011-11-03)
Re: How to eliminate redundant constant move instructions gneuner2@comcast.net (George Neuner) (2011-11-04)
Re: How to eliminate redundant constant move instructions gah@ugcs.caltech.edu (glen herrmannsfeldt) (2011-11-04)
Re: How to eliminate redundant constant move instructions gneuner2@comcast.net (George Neuner) (2011-11-04)
Re: How to eliminate redundant constant move instructions amker.cheng@gmail.com (amker) (2011-11-07)
Re: How to eliminate redundant constant move instructions chenwj@cs.NCTU.edu.tw (Wei-Jen Chen) (2011-11-10)
Re: How to eliminate redundant constant move instructions gneuner2@comcast.net (George Neuner) (2011-11-10)
| List of all articles for this month |

From: glen herrmannsfeldt <gah@ugcs.caltech.edu>
Newsgroups: comp.compilers
Date: Fri, 4 Nov 2011 21:19:14 +0000 (UTC)
Organization: Aioe.org NNTP Server
References: 11-10-019 11-11-004 11-11-005 11-11-014 11-11-018 11-11-023
Keywords: optimize
Posted-Date: 06 Nov 2011 23:48:45 EST

George Neuner <gneuner2@comcast.net> wrote:


(snip)
> Yes. But the original question involve 2 registers both being loaded
> with the same constant value. The OP asked why use a 2nd register. I
> gave a couple of reasons why that might be, and then Glen brought up
> renaming.


I brought up register renaming when someone else brought up
out-of-order execution.


> We haven't seen the actual code, but from the description it appears
> that the compiler could have reused the original register but instead
> chose to use a different one.


There are many possible reasons. For IA32, some registers
have special uses, such that not all can be reused.


> We also don't know what CPU, but regardless, renaming only might
> have been done if the compiler had used a copy instruction.


I do hope that it doesn't load an actual zero from memory.


Also, some zeros should be optimized away. If, for example,
something was then added to the zero.


> With the use of constant loads there was no possibility of renaming
> being performed.


I don't know about others, but the 360/91 can rename loads
from the same address, or store followed by load. Mostly that
was needed with the goal of running unmodified S/360 code, and
the small number of floating point registers.


Is there any machine without a one instruction way to zero
a register?


-- glen


Post a followup to this message

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