This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch combine] Don't create vector mode ZERO_EXTEND from subregs
- From: Jeff Law <law at redhat dot com>
- To: James Greenhalgh <james dot greenhalgh at arm dot com>, gcc-patches at gcc dot gnu dot org
- Cc: nd at arm dot com
- Date: Mon, 11 Dec 2017 14:29:47 -0700
- Subject: Re: [Patch combine] Don't create vector mode ZERO_EXTEND from subregs
- Authentication-results: sourceware.org; auth=none
- References: <1513001933-17348-1-git-send-email-james.greenhalgh@arm.com>
On 12/11/2017 07:18 AM, James Greenhalgh wrote:
>
> Hi,
>
> 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.
>
> This fixes a failure I'm seeing on a branch in which I'm trying to
> tackle some performance regressions, so I have no live testcase for
> this, but it is wrong by observation.
>
> Tested on aarch64-none-elf and bootstrapped on aarch64-none-linux-gnu with
> no issues.
>
> OK?
>
> Thanks,
> James
>
> ---
> 2017-12-11 James Greenhalgh <james.greenhalgh@arm.com>
>
> * combine.c (simplify_set): Do not transform subregs to zero_extends
> if the destination mode is a vector mode.
>
OK. Ideally you'd have a test for the testsuite as well, but I won't
stress without it :-)
jeff