From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 120647 invoked by alias); 11 Dec 2017 21:29:52 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 120637 invoked by uid 89); 11 Dec 2017 21:29:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 11 Dec 2017 21:29:50 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B8438A89C; Mon, 11 Dec 2017 21:29:49 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-2.rdu2.redhat.com [10.10.112.2]) by smtp.corp.redhat.com (Postfix) with ESMTP id B803517563; Mon, 11 Dec 2017 21:29:48 +0000 (UTC) Subject: Re: [Patch combine] Don't create vector mode ZERO_EXTEND from subregs To: James Greenhalgh , gcc-patches@gcc.gnu.org Cc: nd@arm.com References: <1513001933-17348-1-git-send-email-james.greenhalgh@arm.com> From: Jeff Law Message-ID: Date: Mon, 11 Dec 2017 21:29:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <1513001933-17348-1-git-send-email-james.greenhalgh@arm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-12/txt/msg00655.txt.bz2 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 > > * 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