public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Sandiford <richard.sandiford@linaro.org>
To: Hans-Peter Nilsson <hp@bitrange.com>
Cc: gcc@gcc.gnu.org
Subject: Re: Just what are rtx costs?
Date: Thu, 18 Aug 2011 08:14:00 -0000	[thread overview]
Message-ID: <m31uwjrv9z.fsf@richards-thinkpad.stglab.manchester.uk.ibm.com> (raw)
In-Reply-To: <alpine.BSF.2.00.1108172028170.67029@dair.pair.com> (Hans-Peter	Nilsson's message of "Wed, 17 Aug 2011 20:55:18 -0400 (EDT)")

Hans-Peter Nilsson <hp@bitrange.com> writes:
> On Wed, 17 Aug 2011, Richard Sandiford wrote:
>> It also means
>> that constants that are slightly more expensive than a register --
>> somewhere in the range [0, COSTS_N_INSNS (1)] -- end up seeming
>> cheaper than registers.
>
> Yes, perhaps some scale factor has to be applied to get
> reasonable cost granularity in an improved cost model for the
> job...  Some constants *are* more expensive (extra words and/or
> extra cycles), yet preferable to registers for one (or maybe two
> or...) insns.  You don't want to find that all insns except
> constant-loads suddenly use register arguments and no
> port-specific metric way to tweak it.  Mentioned for the record.

I was hoping that if the costs of SETs were "fixed", then that kind of
situation should work without any new scale factors.  E.g. two constant
moves of equal execution frequency that cost COSTS_N_INSNS (1) + 1
(total COSTS_N_INSNS (2) + 2) shouldn't be CSEd (COSTS_N_INSNS (3) + 1)
unless the single constant move can go in a less frequently-executed block.

> I don't think you can get into trouble for trying to improve
> this area for consistency: between releases a port already
> usually arbitrarily loses on some type of codes and costs have
> to be re-tweaked, unless performance is closely tracked.

Yeah, probably true.  Certainly a good excuse for me to use. :-)

> Aiming for traceability can only help (like, "read the added doc
> blurb on how to define the port RTX costs instead of gdb
> stepping and code inspection").

Yeah, that'd be nice.  In practice there's probably always going to be a
bit of experimentation needed.  E.g. getting the cost of multiplicaton
correct wrt shifts and adds can be tricky on a superscalar target.
(At least, it was when I last tried it too many years ago.)

Richard

  reply	other threads:[~2011-08-18  8:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-17 14:52 Richard Sandiford
2011-08-17 17:29 ` Georg-Johann Lay
2011-08-19 12:25   ` Richard Sandiford
2011-08-21 17:03     ` Georg-Johann Lay
2011-08-22  8:20       ` Richard Sandiford
2011-08-22  9:59         ` Richard Guenther
2011-08-22 13:08           ` Joern Rennecke
2011-08-22 15:53             ` David Edelsohn
2011-08-22 12:12         ` Georg-Johann Lay
2011-08-22 23:23       ` Peter Bigot
2011-08-26 14:41         ` Georg-Johann Lay
2011-08-17 18:56 ` Paolo Bonzini
2011-08-18  7:58   ` Richard Sandiford
2011-08-18  0:55 ` Hans-Peter Nilsson
2011-08-18  8:14   ` Richard Sandiford [this message]
2011-08-19 14:17   ` Richard Sandiford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m31uwjrv9z.fsf@richards-thinkpad.stglab.manchester.uk.ibm.com \
    --to=richard.sandiford@linaro.org \
    --cc=gcc@gcc.gnu.org \
    --cc=hp@bitrange.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).