From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 87546 invoked by alias); 6 Nov 2019 14:50:30 -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 87535 invoked by uid 89); 6 Nov 2019 14:50:30 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1985, H*f:sk:mptpni5, H*i:sk:mptpni5 X-HELO: mail-lj1-f194.google.com Received: from mail-lj1-f194.google.com (HELO mail-lj1-f194.google.com) (209.85.208.194) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 06 Nov 2019 14:50:28 +0000 Received: by mail-lj1-f194.google.com with SMTP id k15so14312302lja.3 for ; Wed, 06 Nov 2019 06:50:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IUU9fjBgiHIZ1+rbM2vWBWVWN5jKzUu3Gokoc2Uhq8A=; b=DJGfle5Yx8gNQd4fxUOL4iJMdOhy10z3ou7yE7RWez1NW5NR8rfc0lKIml6GyBXpWk Y4jxcZBY+hBIUKpBd1KgJTCJP/8gBaK506O3pjV+K9Xnjx8uiXJ9N+mmVzeZiKx34fKq 9H0mjNc9glo6e8N+0JzqjxzK30EovQpVruVh2LYfB/sQXlcg29AbG9b1+Um7EdOPddyb aCSuqccVh2q6GvLBj5mjWqadbYeRJ/T399KUX+DMhEo7pXhZwyqCtO1K8UcGprzgjy1v 2zlPBXXdoYKX0PGOb48iEnz8lt4clsV8r2mNellOAjxUwc4o4SbJVwk5n8kg7Nud3ban FQyA== MIME-Version: 1.0 References: In-Reply-To: From: Richard Biener Date: Wed, 06 Nov 2019 14:50:00 -0000 Message-ID: Subject: Re: [4/6] Optionally pick the cheapest loop_vec_info To: Richard Sandiford Cc: "gcc-patches@gcc.gnu.org" Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-11/txt/msg00404.txt.bz2 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. Richard. > > Thanks, > Richard