public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Sandiford <rdsandiford@googlemail.com>
To: Michael Matz <matz@suse.de>
Cc: Richard Sandiford <richard.sandiford@linaro.org>,  gcc@gcc.gnu.org
Subject: Re: Help with ivopts
Date: Wed, 06 Jul 2011 17:55:00 -0000	[thread overview]
Message-ID: <87fwmjwayv.fsf@firetop.home> (raw)
In-Reply-To: <Pine.LNX.4.64.1107061742100.17483@wotan.suse.de> (Michael Matz's	message of "Wed, 6 Jul 2011 17:55:45 +0200 (CEST)")

Michael Matz <matz@suse.de> writes:
> On Wed, 6 Jul 2011, Richard Sandiford wrote:
>> But there's still the separate point that, when not considering
>> addresses, this transformation doesn't seem to be a win, except
>> in the constant case.
>
> My first example shows that on some targets it can be a win, also in the 
> non-constant case, saving one IV update.  That is the case if the use of 
> IVb can be replaced by IVb+somereg for "free".  Be that addresses or not.
>
>> I suppose what I'm saying is that the:
>> 
>>       if (use->iv->base_object
>> 	  && cand->iv->base_object
>> 	  && !operand_equal_p (use->iv->base_object, cand->iv->base_object, 0))
>> 	return infinite_cost;
>> 
>> condition seems to make sense in the !address_p case too.  It shouldn't
>> make things worse, and may make things better.
>
> It would make things worse for the above mentioned targets.  I actually 
> think this whole special casing of address_p just hides problems 
> elsewhere, namely in the alising machinery (as I hinted, this might 
> actually be solved meanwhile), and certainly in the cost functions of 
> IVopts.  If it's really better to not express a certain use of IVb via 
> ((base_b-base_a)+IVa), then the cost function should say so, not some 
> after-the-fact hackery rejecting this transformation a posteriori.
>
> If this rejection should still be needed for correctness for the aliasing 
> machinery then it should be limited to that one purpose: avoiding wrong 
> code.  It should not be used to avoid generating worse code on some 
> targets.

OK, I suppose I'd better just live with things as they are then.
My main motivation for getting the uses to be considered as addresses
is precisely to trigger the address_p code that you'd like to remove,
so it wouldn't be a permanent fix.

With that code removed, I think we'll still hit the problem that,
all other things being equal (as they appear to be in this case),
we prefer to reuse ivs rather than create new ones.

Richard

      reply	other threads:[~2011-07-06 17:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-06 11:35 Richard Sandiford
2011-07-06 13:10 ` Michael Matz
2011-07-06 13:32   ` Richard Sandiford
2011-07-06 13:43     ` Richard Sandiford
2011-07-06 14:40       ` Michael Matz
2011-07-06 15:04         ` Richard Sandiford
2011-07-06 15:17           ` Michael Matz
2011-07-06 15:34             ` Richard Sandiford
2011-07-06 15:56               ` Michael Matz
2011-07-06 17:55                 ` Richard Sandiford [this message]

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=87fwmjwayv.fsf@firetop.home \
    --to=rdsandiford@googlemail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=matz@suse.de \
    --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).