From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68995 invoked by alias); 8 Nov 2019 12:15:00 -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 68987 invoked by uid 89); 8 Nov 2019 12:15:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-4.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.1 spammy=H*i:sk:CAFiYyc, H*i:sk:O2R_92i, H*f:sk:O2R_92i X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.110.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 08 Nov 2019 12:14:58 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 25FC546A; Fri, 8 Nov 2019 04:14:56 -0800 (PST) Received: from localhost (e121540-lin.manchester.arm.com [10.32.98.126]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 85F1A3F719; Fri, 8 Nov 2019 04:14:55 -0800 (PST) From: Richard Sandiford To: Richard Biener Mail-Followup-To: Richard Biener ,"gcc-patches\@gcc.gnu.org" , mliska@suse.cz, richard.sandiford@arm.com Cc: "gcc-patches\@gcc.gnu.org" , mliska@suse.cz Subject: Re: [4/6] Optionally pick the cheapest loop_vec_info References: Date: Fri, 08 Nov 2019 12:15:00 -0000 In-Reply-To: (Richard Biener's message of "Fri, 8 Nov 2019 12:27:39 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2019-11/txt/msg00609.txt.bz2 Richard Biener writes: > On Thu, Nov 7, 2019 at 6:15 PM Richard Sandiford > wrote: >> >> Richard Biener writes: >> > On Wed, Nov 6, 2019 at 3:01 PM Richard Sandiford >> > wrote: >> >> >> >> Richard Biener writes: >> >> > On Tue, Nov 5, 2019 at 3:29 PM Richard Sandiford >> >> > wrote: >> >> >> >> >> >> This patch adds a mode in which the vectoriser tries each available >> >> >> base vector mode and picks the one with the lowest cost. For now >> >> >> the behaviour is behind a default-off --param, but a later patch >> >> >> enables it by default for SVE. >> >> >> >> >> >> The patch keeps the current behaviour of preferring a VF of >> >> >> loop->simdlen over any larger or smaller VF, regardless of costs >> >> >> or target preferences. >> >> > >> >> > Can you avoid using a --param for this? Instead I'd suggest to >> >> > amend the vectorize_modes target hook to return some >> >> > flags like VECT_FIRST_MODE_WINS. We'd eventually want >> >> > to make the target able to say do-not-vectorize-epiloges-of-MODE >> >> > (I think we may not want to vectorize SSE vectorized loop >> >> > epilogues with MMX-with-SSE or GPRs for example). I guess >> >> > for the latter we'd use a new target hook. >> >> >> >> The reason for using a --param was that I wanted a way of turning >> >> this on and off on the command line, so that users can experiment >> >> with it if necessary. E.g. enabling the --param could be a viable >> >> alternative to -mprefix-* in some cases. Disabling it would be >> >> a way of working around a bad cost model decision without going >> >> all the way to -fno-vect-cost-model. >> >> >> >> These kinds of --params can become useful workarounds until an >> >> optimisation bug is fixed. >> > >> > I'm arguing that the default depends on the actual ISAs so there isn't >> > a one-fits all and given we have OMP SIMD and target cloning for >> > multiple ISAs this looks like a wrong approach. For sure the >> > target can use its own switches to override defaults here, or alternatively >> > we might want to have a #pragma GCC simdlen mimicing OMP behavior >> > here. >> >> I agree there's no one-size-fits-all choice here, but that's true for >> other --params too. The problem with using target switches is that we >> have to explain them and to keep accepting them "forever" (or at least >> with a long deprecation period). > > Fortunately next week you'll be able to add target specific --params > to your targets .opt file ;) Nice! That definitely sounds like a good compromise. :-) I'll hold off on 6/6 until Martin's patches have gone in. There are a couple of other SVE things that would benefit from that too. Thanks, Richard