Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #326

Re: How to eliminate redundant constant move instructions

From glen herrmannsfeldt <gah@ugcs.caltech.edu>
Newsgroups comp.compilers
Subject Re: How to eliminate redundant constant move instructions
Date 2011-11-04 21:19 +0000
Organization Aioe.org NNTP Server
Message-ID <11-11-024@comp.compilers> (permalink)
References (1 earlier) <11-11-004@comp.compilers> <11-11-005@comp.compilers> <11-11-014@comp.compilers> <11-11-018@comp.compilers> <11-11-023@comp.compilers>

Show all headers | View raw


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

Back to comp.compilers | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

How to eliminate redundant constant move instructions "Amker.Cheng" <amker.cheng@gmail.com> - 2011-10-31 17:53 +0800
  Re: How to eliminate redundant constant move instructions Kaz Kylheku <kaz@kylheku.com> - 2011-10-31 17:08 +0000
    Re: How to eliminate redundant constant move instructions amker <can.finner@gmail.com> - 2011-11-01 19:01 -0700
    Re: How to eliminate redundant constant move instructions mac <acolvin@efunct.com> - 2011-11-03 02:20 +0000
  Re: How to eliminate redundant constant move instructions George Neuner <gneuner2@comcast.net> - 2011-11-01 14:32 -0400
    Re: How to eliminate redundant constant move instructions glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2011-11-01 22:35 +0000
      Re: How to eliminate redundant constant move instructions amker <can.finner@gmail.com> - 2011-11-01 19:35 -0700
      Re: How to eliminate redundant constant move instructions amker <amker.cheng@gmail.com> - 2011-11-01 21:04 -0700
      Re: How to eliminate redundant constant move instructions George Neuner <gneuner2@comcast.net> - 2011-11-02 12:38 -0400
        Re: How to eliminate redundant constant move instructions Kaz Kylheku <kaz@kylheku.com> - 2011-11-03 03:20 +0000
          Re: How to eliminate redundant constant move instructions George Neuner <gneuner2@comcast.net> - 2011-11-04 13:27 -0400
            Re: How to eliminate redundant constant move instructions glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2011-11-04 21:19 +0000
        Re: How to eliminate redundant constant move instructions glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2011-11-03 03:32 +0000
    Re: How to eliminate redundant constant move instructions amker <can.finner@gmail.com> - 2011-11-01 19:21 -0700
      Re: How to eliminate redundant constant move instructions George Neuner <gneuner2@comcast.net> - 2011-11-04 17:26 -0400
        Re: How to eliminate redundant constant move instructions amker <amker.cheng@gmail.com> - 2011-11-07 17:33 -0800
          Re: How to eliminate redundant constant move instructions Wei-Jen Chen <chenwj@cs.NCTU.edu.tw> - 2011-11-10 08:04 +0000
          Re: How to eliminate redundant constant move instructions George Neuner <gneuner2@comcast.net> - 2011-11-10 18:18 -0500
    Re: How to eliminate redundant constant move instructions amker <amker.cheng@gmail.com> - 2011-11-01 20:58 -0700

csiph-web