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


Groups > comp.compilers > #326

Re: How to eliminate redundant constant move instructions

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.iecc.com!nerds-end
From glen herrmannsfeldt <gah@ugcs.caltech.edu>
Newsgroups comp.compilers
Subject Re: How to eliminate redundant constant move instructions
Date Fri, 4 Nov 2011 21:19:14 +0000 (UTC)
Organization Aioe.org NNTP Server
Lines 38
Sender news@iecc.com
Approved comp.compilers@iecc.com
Message-ID <11-11-024@comp.compilers> (permalink)
References <11-10-019@comp.compilers> <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>
NNTP-Posting-Host news.iecc.com
X-Trace leila.iecc.com 1320641325 82738 64.57.183.58 (7 Nov 2011 04:48:45 GMT)
X-Complaints-To abuse@iecc.com
NNTP-Posting-Date Mon, 7 Nov 2011 04:48:45 +0000 (UTC)
Keywords optimize
Posted-Date 06 Nov 2011 23:48:45 EST
X-submission-address compilers@iecc.com
X-moderator-address compilers-request@iecc.com
X-FAQ-and-archives http://compilers.iecc.com
Xref x330-a1.tempe.blueboxinc.net comp.compilers:326

Show key headers only | 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