From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 58441 invoked by alias); 28 Aug 2017 09:04:53 -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 113976 invoked by uid 89); 28 Aug 2017 09:00:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 28 Aug 2017 08:59:59 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id A72A1ABB1; Mon, 28 Aug 2017 08:59:56 +0000 (UTC) Date: Mon, 28 Aug 2017 11:41:00 -0000 From: Richard Biener To: Jon Beniston cc: gcc-patches@gcc.gnu.org Subject: RE: [RFC, vectorizer] Allow single element vector types for vector reduction operations In-Reply-To: <000001d31fd7$b239abb0$16ad0310$@beniston.com> Message-ID: References: <015b01d31f6b$c3651620$4a2f4260$@beniston.com> <000001d31fd7$b239abb0$16ad0310$@beniston.com> User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SW-Source: 2017-08/txt/msg01566.txt.bz2 On Mon, 28 Aug 2017, Jon Beniston wrote: > Hi Richard, > > >- if (nunits < 1) /* Support V1SI. */ > >+ if (nunits < 1 || (nunits == 1 && !reduct_p)) > > return NULL_TREE; > > > >doesn't seem to be against trunk which has > > > > if (nunits <= 1) > > return NULL_TREE; > > > >so what happens if you just change that to > > > > if (nunits < 1) > > return NULL_TREE; > > Ah, that's what I first tried, and mistakenly sent the patch against that. > > That did help the initial problem, but then I needed to add a lot of support > for the V1SI type in the backend (which just duplicated SI patterns) and > there are a few places where GCC seems to have sanity checks against vectors > that are only one element wide. A dot product producing a scalar result > seems natural. Where do you need V1SI types? The vectorizer should perform a SI extract from V1SI here. You need to elaborate a bit here. > > Also, as well as ARC benefitting from this, I think the TI c6x port would > too. That currently has a sdot_prodv2hi pattern that uses SI and V2HI types. The vectorizer doesn't really support vector->scalar ops so V1SI feels more natural here. That is, your patch looks a bit ugly -- there's nothing wrong with V1SI vector types. So maybe instead of adjusting that function the respective caller when facing a lane-reducing op such as DOT_PROD needs to consider scalar result types. Richard. > Cheers, > Jon > > > -- Richard Biener SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)