public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kyrill Tkachov <kyrylo.tkachov@foss.arm.com>
To: Segher Boessenkool <segher@kernel.crashing.org>,
	 Bernd Schmidt <bschmidt@redhat.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH][combine][RFC][2/2] PR rtl-optimization/68796: Perfer zero_extract comparison against zero rather than unsupported shorter modes
Date: Thu, 17 Dec 2015 17:44:00 -0000	[thread overview]
Message-ID: <5672F474.5070306@foss.arm.com> (raw)
In-Reply-To: <20151217172732.GA20301@gate.crashing.org>


On 17/12/15 17:27, Segher Boessenkool wrote:
> On Thu, Dec 17, 2015 at 05:12:16PM +0100, Bernd Schmidt wrote:
>> On 12/17/2015 05:10 PM, Kyrill Tkachov wrote:
>>> Well, this patch still produces the QImode comparison if the target has
>>> a QImode comparison
>>> (the have_insn_for check in the simplify_comparison hunk).
>> Ok, I didn't look that closely because I had doubts about the approach.
>> This kind of check also goes somewhat against the principles of just
>> producing canonical forms of RTL.
> The canonicalisation rules exist so that optimisers only need to match
> one form instead of several, and machine descriptions only need to
> describe one form instead of several.  For this bitmasking case it
> perversely forces you to describe the same instruction in many ways,
> for many targets.  This is what the change_zero_ext was about as well.
>
> It's not so easy to fix for the compare case.  Maybe the idea of making
> genrecog make code that recognises more forms of the same insn will work
> out.  GCC 7 in any case...

Perhaps I had underestimated how involved this issue is :)
So if I want to improve the aarch64 situation for GCC 6,
would the recommended course of action be to just define the
QI and HImode compare against zero patterns?

Note that I think the make_extraction hunk from my patch is in line
with the function comment of make_extraction that says:
"   IN_COMPARE is nonzero if we are in a COMPARE.  This means that a
     ZERO_EXTRACT should be built even for bits starting at bit 0."

whereas the condition that I'm adding "&& !in_compare" is explicitly trying
to avoid an extraction.

But anyway, if this has the potential to cause negative fallout that I
had not anticipated, it can wait for later.

Thanks,
Kyrill

>
> Segher

  reply	other threads:[~2015-12-17 17:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-17 15:36 Kyrill Tkachov
2015-12-17 15:58 ` Bernd Schmidt
2015-12-17 16:10   ` Kyrill Tkachov
2015-12-17 16:12     ` Bernd Schmidt
2015-12-17 16:26       ` Kyrill Tkachov
2015-12-17 16:59         ` Jeff Law
2015-12-17 17:05           ` Kyrill Tkachov
2015-12-17 17:33             ` Jeff Law
2015-12-17 17:27       ` Segher Boessenkool
2015-12-17 17:44         ` Kyrill Tkachov [this message]
2015-12-17 18:05           ` Bernd Schmidt
2015-12-17 16:46   ` Jeff Law
2015-12-17 16:52   ` Jeff Law

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=5672F474.5070306@foss.arm.com \
    --to=kyrylo.tkachov@foss.arm.com \
    --cc=bschmidt@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=segher@kernel.crashing.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).