public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Sandiford <richard.sandiford@arm.com>
To: Richard Biener <richard.guenther@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: Remove redundant AND from count reduction loop
Date: Wed, 24 Jun 2015 13:53:00 -0000	[thread overview]
Message-ID: <87twtxqlbq.fsf@e105548-lin.cambridge.arm.com> (raw)
In-Reply-To: <CAFiYyc1Q_NJftYjH49v+konjyiOZw_hzJ6un31R_mizdhk60=w@mail.gmail.com>	(Richard Biener's message of "Wed, 24 Jun 2015 13:58:39 +0100")

>>> There is precedence for different
>>> expansion paths dependent on optabs (or even rtx cost?).  Of course
>>> expand_unop doesn't get the original tree ops (expand_expr.c does,
>>> where some special-casing using get_gimple_for_expr is).  Not sure
>>> if expand_unop would get 'cond' in a form where it can recognize
>>> the result is either -1 or 0.
>>
>> It just seems inconsistent to have the optabs machinery try to detect
>> this ad-hoc combination opportunity while still leaving the vcond optab
>> to handle more arbitrary cases, like (vec_cond (eq x y) 0xbeef 0).
>> The vcond optabs would still have the logic needed to produce the
>> right code, but we'd be circumventing it and trying to reimplement
>> one particular case in a different way.
>
> That's true.  One could also leave it to combine / simplify_rtx and
> thus rtx_cost.  But that's true of all of the match.pd stuff you add, no?

It's probably true of most match.pd stuff in general though :-)
One advantage of match.pd of course is that it works across
block boundaries.

The difference between the stuff I added and converting vec_cond_expr
to negate is that the stuff I added avoids the vec_cond_expr altogether
and so ought to be an unequivocal win.  Replacing vec_cond_expr with
negate just rewrites it into another (arguably more surprising) form.

Thanks,
Richard

  reply	other threads:[~2015-06-24 13:37 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-23 15:42 Richard Sandiford
2015-06-23 21:36 ` Marc Glisse
2015-06-24  9:25   ` Richard Biener
2015-06-24  9:59     ` Richard Sandiford
2015-06-24 10:22       ` Richard Biener
2015-06-24 11:29         ` Richard Sandiford
2015-06-24 11:56           ` Richard Biener
2015-06-24 12:37             ` Richard Sandiford
2015-06-24 13:11               ` Richard Biener
2015-06-24 13:53                 ` Richard Sandiford [this message]
2015-06-24 14:09                   ` Richard Biener
2015-06-25  8:19                     ` Richard Sandiford
2015-06-25 10:39                       ` Richard Biener
2015-06-25 11:52                         ` Richard Sandiford
2015-06-25 13:17                           ` Richard Biener
2015-06-24 16:42             ` Jeff Law
2015-06-25 22:48         ` Marc Glisse
2015-06-26  9:59           ` Richard Biener
2015-06-28 14:09             ` Marc Glisse
2015-06-29  9:16               ` Richard Biener

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=87twtxqlbq.fsf@e105548-lin.cambridge.arm.com \
    --to=richard.sandiford@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.guenther@gmail.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).