From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32674 invoked by alias); 22 Feb 2018 18:56:23 -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 32654 invoked by uid 89); 22 Feb 2018 18:56:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-io0-f193.google.com Received: from mail-io0-f193.google.com (HELO mail-io0-f193.google.com) (209.85.223.193) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 22 Feb 2018 18:56:21 +0000 Received: by mail-io0-f193.google.com with SMTP id e7so7119828ioj.1 for ; Thu, 22 Feb 2018 10:56:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=vw7a7CWQkERBDv+4Q1zUC2Tdln+lZQoVIZLgngMYkL8=; b=IMBq51oD65ZVO/R2Tk3UcMZz2DCYZiyP/TgUrbyWaJPAJXDA1LLADNsJloxeQWPRBr mjB97X+XNfvSFpp1gyxf2hEWTGLU0bfF6a/27tb6HNyQsHqid86EdY6Z3973IRKnR/IS 8sQko/Vsxw+LdIvCPWEJJYcHFjn2R2ugeAVeMr99iWVRdMpNXkmz2IaaZyaLinCAgoHA n5LCTtL8UjpNF660ZRURXqRd9V0E2xa22zDYCugSexeX6n3NVm+78UScqBWmOYhN/wUl ESC/WyN9y8lfbajd8WGE47XE3X1ZHdVvNef1KR594IyALPUXvYtCgcOGDYN1Pt25TEAw W/1w== X-Gm-Message-State: APf1xPAHRVizO/JuYjcUejZDT3olqdAH1CKexr1a9Ghs2GurZMucsm5/ 0OLhk60rh+im+PH2P/hWjPqVfMydt+u0ISFzwWg= X-Google-Smtp-Source: AG47ELteJq/Sr1VgZoThlvpIaEdLBkbhAQ0ewEsMmoUh8CjtQtIg0wdZ3lM3d3CrXSAntfzS/VbidtYQdXFdWnMMIDo= X-Received: by 10.107.186.135 with SMTP id k129mr9923403iof.200.1519325779703; Thu, 22 Feb 2018 10:56:19 -0800 (PST) MIME-Version: 1.0 Received: by 10.2.21.21 with HTTP; Thu, 22 Feb 2018 10:56:19 -0800 (PST) In-Reply-To: <20180222181658.GW5867@tucnak> References: <20180222181658.GW5867@tucnak> From: Uros Bizjak Date: Thu, 22 Feb 2018 18:56:00 -0000 Message-ID: Subject: Re: [PATCH] Tweak gcc.target/i386/avx2-vp{add,sub}q-3.c (PR target/82851) To: Jakub Jelinek Cc: Kirill Yukhin , "gcc-patches@gcc.gnu.org" Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2018-02/txt/msg01304.txt.bz2 On Thu, Feb 22, 2018 at 7:16 PM, Jakub Jelinek wrote: > Hi! > > These tests FAIL the vp.*q.*ymm insn scan with some tunings, e.g. > -mtune=silvermont or -mtune=atom, because vectorizing it using AVX2 > is based on costs considered too expensive. > E.g. for -mtune=silvermont I see for VF 4: > > avx2-vpop-check.h:16:3: note: Cost model analysis: > Vector inside of loop cost: 330 > Vector prologue cost: 0 > Vector epilogue cost: 0 > Scalar iteration cost: 48 > Scalar outside cost: 0 > Vector outside cost: 0 > prologue iterations: 0 > epilogue iterations: 0 > avx2-vpop-check.h:16:3: note: cost model: the vector iteration cost = 330 divided by the scalar iteration cost = 48 is greater or equal to the vect > orization factor = 4. > avx2-vpop-check.h:16:3: note: not vectorized: vectorization not profitable. > avx2-vpop-check.h:16:3: note: not vectorized: vector version will never be profitable. > avx2-vpop-check.h:16:3: note: ***** Re-trying analysis with vector size 16 > > while with -mtune=generic I see: > > avx2-vpop-check.h:16:3: note: Cost model analysis: > Vector inside of loop cost: 64 > Vector prologue cost: 0 > Vector epilogue cost: 0 > Scalar iteration cost: 40 > Scalar outside cost: 0 > Vector outside cost: 0 > prologue iterations: 0 > epilogue iterations: 0 > Calculated minimum iters for profitability: 0 > > I think we can either use -mtune=generic as in the patch below, > or add -fno-vect-cost-model. > > Tested on x86_64-linux with: > make check-gcc RUNTESTFLAGS='--target_board=unix\{-m32,-m32/-mtune=silvermont,-m32/-mtune=atom,-m64,-m64/-mtune=silvermont,-m64/-mtune=atom\} i386.exp=avx2-vp*q-3.c' > Ok for trunk? > > 2018-02-22 Jakub Jelinek > > PR target/82851 > * gcc.target/i386/avx2-vpaddq-3.c: Add -mtune=generic to dg-options. > * gcc.target/i386/avx2-vpsubq-3.c: Likewise. OK. Thanks, Uros. > --- gcc/testsuite/gcc.target/i386/avx2-vpaddq-3.c.jj 2015-05-29 15:02:59.475249515 +0200 > +++ gcc/testsuite/gcc.target/i386/avx2-vpaddq-3.c 2018-02-22 18:44:45.353178253 +0100 > @@ -1,5 +1,5 @@ > /* { dg-do run } */ > -/* { dg-options "-mavx2 -mno-prefer-avx128 -O2 -ftree-vectorize -save-temps" } */ > +/* { dg-options "-mavx2 -mno-prefer-avx128 -O2 -ftree-vectorize -mtune=generic -save-temps" } */ > /* { dg-require-effective-target avx2 } */ > > > --- gcc/testsuite/gcc.target/i386/avx2-vpsubq-3.c.jj 2015-05-29 15:03:00.572232560 +0200 > +++ gcc/testsuite/gcc.target/i386/avx2-vpsubq-3.c 2018-02-22 18:45:02.131168864 +0100 > @@ -1,5 +1,5 @@ > /* { dg-do run } */ > -/* { dg-options "-mavx2 -mno-prefer-avx128 -O2 -ftree-vectorize -save-temps" } */ > +/* { dg-options "-mavx2 -mno-prefer-avx128 -O2 -ftree-vectorize -mtune=generic -save-temps" } */ > /* { dg-require-effective-target avx2 } */ > > > > Jakub