From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by sourceware.org (Postfix) with ESMTPS id CBC0E3858D20; Fri, 14 Apr 2023 09:15:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CBC0E3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-x12c.google.com with SMTP id i6so10851167lfp.1; Fri, 14 Apr 2023 02:15:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681463703; x=1684055703; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=H+gyubOXkEe7WZiZ1NypZzsEMXvM/cVFPe0QeOTaSSI=; b=Q8VZ1aIQ06P5FAGvHXgzfCSWZnm+KliGl7VmhE24DtI0v27vsydcT8rYhcpAO05XZ9 8L+F2vXLnwtg8anxq6QYT3oDyOmJHV2shh+NsurL9+57HzzJ4TZ/bgmSO8x1n3znUl29 PBlj/RdQFACShpdQs3feda02M5Al4CqNxxr4W+ss0cWs/NMkh8s0wBKD91fJ76GpcpKL ZxgFS86xuC2Rv8/ObYQ9exkTYOlF6L4+zd5/uLonlpD4crRV6bMB1XjjLXuLO+eyq3gJ y+BCQdDwIx2HLzx7Oj4ymoaaWZ/u5JVPbePQekMP2PY5vWFLKO3v4kehy0jQ8h+xlZbm FgaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681463703; x=1684055703; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=H+gyubOXkEe7WZiZ1NypZzsEMXvM/cVFPe0QeOTaSSI=; b=CzQ7oriD+D/A7OW7Ks9xdFrdNkNiXZhzv6vCnky+i/BvxoZRSIYg5J1iQOeZ4IDf3H AeMUdqf7suItkGMv0Aolu3CtmZrwJ94pkMa5at2NrvIJXMxMQuQPzImq12hsHrFltdhk RZvmt6Gi/OcvcRR2YPyQ/gC6nIsSYV3fu0mQI8JsqEyNoQnkUCSlhHysd4KNIE93X9Re nqxJbiPZUzvuH0GjPdjy9wA4+B2saTSnG5HPm0sno7rcRzQpb17xMwyqNrzwlsVQ97OX Eo8nYBnU7f3X1relL1bFpK54eJqTmk1h+/juXXj576GRGmfUGBLq3HCkpZhddvw46Gtr Rvxg== X-Gm-Message-State: AAQBX9fPjAjNGY0H6u4bsYj0CgoWFLo664QJgiWOvuhwnRG/asOlCSfr mngRIFeFPYemb7DcLZ29EybNyTHew7u1xMN8NPE= X-Google-Smtp-Source: AKy350YPPqYQdJ8WP5Rs4bpRKDgjqExTPodji7ahdTkbvyN3DmwcitCFsKAWfBpPO0I3PrEjLD4vtlBfdhTQq6aNrmA= X-Received: by 2002:ac2:430a:0:b0:4e9:c027:5be6 with SMTP id l10-20020ac2430a000000b004e9c0275be6mr1610782lfh.12.1681463703026; Fri, 14 Apr 2023 02:15:03 -0700 (PDT) MIME-Version: 1.0 References: <202304130148.33D1mmns1987590@shliclel4214.sh.intel.com> <341dd608-a512-3c74-303d-1942876a3850@arm.com> In-Reply-To: From: Richard Biener Date: Fri, 14 Apr 2023 11:14:51 +0200 Message-ID: Subject: Re: [r13-7135 Regression] FAIL: gcc.dg/vect/vect-simd-clone-18f.c scan-tree-dump-times vect "[\\n\\r] [^\\n]* = foo\\.simdclone" 2 on Linux/x86_64 To: "Andre Vieira (lists)" Cc: Andrew Stubbs , "gcc-regression@gcc.gnu.org" , "gcc-patches@gcc.gnu.org" , "haochen.jiang@intel.com" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, Apr 14, 2023 at 11:09=E2=80=AFAM Richard Biener wrote: > > On Fri, Apr 14, 2023 at 10:43=E2=80=AFAM Andre Vieira (lists) > wrote: > > > > Resending this to everyone (sorry for the double send Richard). > > > > On 14/04/2023 09:15, Andre Vieira (lists) wrote: > > > > > > > > > On 14/04/2023 07:55, Richard Biener wrote: > > >> On Thu, Apr 13, 2023 at 4:25=E2=80=AFPM Andre Vieira (lists) > > >> wrote: > > >>> > > >>> > > >>> > > >>> On 13/04/2023 15:00, Richard Biener wrote: > > >>>> On Thu, Apr 13, 2023 at 3:00=E2=80=AFPM Andre Vieira (lists) via = Gcc-patches > > >>>> wrote: > > >>>>> > > >>>>> > > >>>>> > > >>> > > >>> But that's not it, I've been looking at it, and there is code in p= lace > > >>> that does what I expected which is defer the choice of vectype for= simd > > >>> clones until vectorizable_simd_clone_call, unfortunately it has a > > >>> mistaken assumption that simdclones don't return :/ > > >> > > >> I think that's not it - when the SIMD clone returns a vector we hav= e to > > >> determine the vector type in this function. We cannot defer this. > > > > > > What's 'this function' here, do you mean we have to determine the > > > vectype in 'vect_get_vector_types_for_stmt' & > > > 'vect_determine_vf_for_stmt' ? > > Yes. > > > Because at that time we don't yet know > > > what clone we will be using, this choice is done inside > > > vectorizable_simd_clone_call. In fact, to choose the simd clone, we = need > > > to know the vf as that has to be a multiple of the chosen clone's > > > simdlen. So we simply can't use the simdclone's types (as that depen= ds > > > on the simdlen) to choose the vf because the choice of simdlend depe= nds > > > on the vf. And there was already code in place to handle this, > > > unfortunately that code was wrong and had the wrong assumption that > > > simdclones didn't return (probably was true at some point and bitrot= ted). > > But to compute the VF we need to know the vector types! We're only > calling vectorizable_* when the VF is final. That said, the code you quo= te: > > > >> > > >>> see vect_get_vector_types_for_stmt: > > >>> ... > > >>> if (gimple_get_lhs (stmt) =3D=3D NULL_TREE > > is just for the case of a function without return value. For this case > it's OK to do nothing - 'vectype' is the vector type of all vector defs > a stmt produces. > > For calls with a LHS it should fall through to generic code doing > get_vectype_for_scalar_type on the LHS type. Isn't just the target selector wrong in these tests? /* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* =3D foo\.simdclone} 2 "vect" { target { { ! avx_runtime } && { ! { i686*-*-* && { ! lp64 } } } } } } } */ /* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* =3D foo\.simdclone} 3 "vect" { target { avx_runtime && { ! { i686*-*-* && { ! lp64 } } } } } } } */ /* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* =3D foo\.simdclone} 4 "vect" { target { i686*-*-* && { ! lp64 } } } } } */ the i686-*-* should be { i?86-*-* x86_64-*-* } && { ! lp64 } to properly check x86_64 -m32? I'm going to patch that. Richard. > > >>> /* MASK_STORE has no lhs, but is ok. */ > > >>> && !gimple_call_internal_p (stmt, IFN_MASK_STORE)) > > >>> { > > >>> if (is_a (stmt)) > > >>> { > > >>> /* Ignore calls with no lhs. These must be calls to > > >>> #pragma omp simd functions, and what vectorization > > factor > > >>> it really needs can't be determined until > > >>> vectorizable_simd_clone_call. */ > > >>> if (dump_enabled_p ()) > > >>> dump_printf_loc (MSG_NOTE, vect_location, > > >>> "defer to SIMD clone analysis.\n"); > > >>> return opt_result::success (); > > >>> } > > >>> > > >>> return opt_result::failure_at (stmt, > > >>> "not vectorized: irregular > > >>> stmt.%G", stmt); > > >>> } > > >>> ... > > >>> > > >>> I'm working on a patch. > > >>>> > > >>>>> Kind Regards, > > >>>>> Andre