public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Guenther <richard.guenther@gmail.com>
To: Georg-Johann Lay <avr@gjlay.de>,
	gcc@gcc.gnu.org, richard.sandiford@linaro.org
Subject: Re: Just what are rtx costs?
Date: Mon, 22 Aug 2011 09:59:00 -0000	[thread overview]
Message-ID: <CAFiYyc3X1pBRFNoUC2QPNTobuWWdW+q3Qha5uJmKTd=_cMij2w@mail.gmail.com> (raw)
In-Reply-To: <m3zkj1rh75.fsf@richards-thinkpad.stglab.manchester.uk.ibm.com>

On Mon, Aug 22, 2011 at 10:19 AM, Richard Sandiford
<richard.sandiford@linaro.org> wrote:
> Georg-Johann Lay <avr@gjlay.de> writes:
>>>>IMO a clean approach would be to query the costs of a whole insn (resp.
>>>>it's pattern) rather than the cost of an RTX.  COSTS_N_INSNS already
>>>>indicates that the costs are compared to *insn* costs i.e. cost of the
>>>>whole pattern (modulo clobbers).
>>>
>>> The problem is that we sometimes want the cost of something that cannot
>>> be done using a single instruction.  E.g. some CONST_INTs take several
>>> instructions to create on MIPS.  In this case the costs are really
>>> measuring the cost of an emit_move_insn sequence, not a single insn.
>>>
>>> I suppose we could use emit_move_insn to create a temporary sequence
>>> and sum the cost of each individual instruction.  But that's potentially
>>> expensive.
>>
>> No, that complexity is not needed.  For (set (reg) (const_int)) the BE
>> can just return the cost of the expanded sequence because it knows how
>> it will be expanded and how much it will cost.  There's no need to
>> really expand the sequence.
>
> Sorry, I'd misunderstood your suggestion.  I thought you were suggesting
> that the rtx costs functions should only be presented with SETs that are
> valid instructions.  I hadn't realised that you were still allowing these
> SETs to be arbitrary ones that have been cooked up by the optimisers.
>
> So are you saying that we should remove the recursive nature of the
> rtx_cost/targetm.rtx_costs interface, and have the backend handle any
> recursion itself?  I.e. targetm.rtx_costs only ever sees a complete
> (but perhaps invalid) instruction pattern?  Or would you still keep
> the current recursion?

I would say yes to that - kill the recursion.

Richard.

> Richard
>

  reply	other threads:[~2011-08-22  9:59 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 [this message]
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
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='CAFiYyc3X1pBRFNoUC2QPNTobuWWdW+q3Qha5uJmKTd=_cMij2w@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=avr@gjlay.de \
    --cc=gcc@gcc.gnu.org \
    --cc=richard.sandiford@linaro.org \
    /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).