public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: James Greenhalgh <james.greenhalgh@arm.com>
Cc: gcc-patches@gcc.gnu.org, nd@arm.com, law@redhat.com
Subject: Re: [Patch combine] Don't create vector mode ZERO_EXTEND from subregs
Date: Sun, 17 Dec 2017 03:14:00 -0000	[thread overview]
Message-ID: <20171217031407.GJ10515@gate.crashing.org> (raw)
In-Reply-To: <1513001933-17348-1-git-send-email-james.greenhalgh@arm.com>

Hi!

On Mon, Dec 11, 2017 at 02:18:53PM +0000, James Greenhalgh wrote:
> 
> In simplify_set we try transforming the paradoxical subreg expression:
> 
>   (set FOO (subreg:M (mem:N BAR) 0))
> 
> in to:
> 
>   (set FOO (zero_extend:M (mem:N BAR)))
> 
> However, this code does not consider the case where M is a vector
> mode, allowing it to construct (for example):
> 
>   (zero_extend:V4SI (mem:SI))
> 
> This would clearly have the wrong semantics, but fortunately we fail long
> before then in expand_compound_operation. As we really don't want a vector
> zero_extend of a scalar value.
> 
> We need to explicitly reject vector modes from this transformation.

It does not consider any other modes either.  Both modes involved are
required to be SCALAR_INT_MODE_P (for zero_extend to be valid at all and
to be equivalent to the subreg); could you test for that instead please?


Segher

  parent reply	other threads:[~2017-12-17  3:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-11 14:19 James Greenhalgh
2017-12-11 15:46 ` [patch AArch64] Do not perform a vector splat for vector initialisation if it is not useful James Greenhalgh
2017-12-18 23:37   ` Jeff Law
2018-01-03  9:55     ` Christophe Lyon
2017-12-11 21:29 ` [Patch combine] Don't create vector mode ZERO_EXTEND from subregs Jeff Law
2017-12-16 14:04 ` Marc Glisse
2017-12-17  3:14 ` Segher Boessenkool [this message]
2017-12-21 16:35   ` James Greenhalgh

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=20171217031407.GJ10515@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=james.greenhalgh@arm.com \
    --cc=law@redhat.com \
    --cc=nd@arm.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).