From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by sourceware.org (Postfix) with ESMTPS id B19433858D33; Fri, 14 Apr 2023 09:09:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B19433858D33 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-x136.google.com with SMTP id q26so10356981lfe.9; Fri, 14 Apr 2023 02:09:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681463397; x=1684055397; 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=WSHP+ptCDkG2xyNvtt3hPZabcg4rK/PGNWdbhhrtpNs=; b=MA8dE31EqhZRfNnO4ywHgJer4SmsnilRkeoHhkmZ1WzLoE5a+12vkkhSVO7kpYYw6d reXHk0jeINpe4r4uowmEGuhgljqsPOgNgDTHG8HPcnejPp1wj9VzYHeuyoxxNvnNjqmN p1xtl1cDI67lVrxmSPafmCoTzVTlDwzxFgKf7rbQ3K6PtsuFkzTFIzHfA2LOh3ShVxib QA7PAjd4If/xgAJwyDKEj8ObsWnU3LFE0HP6N34AfgxQAwAQI3MnSEYMMLZLtUfNCAh+ +dRadc2RESXB7QSZ9EWie3FL6T59VkcJuUc5F/f5/LkXNFyBbqB9G0ow9gCgE20NiXhK YCww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681463397; x=1684055397; 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=WSHP+ptCDkG2xyNvtt3hPZabcg4rK/PGNWdbhhrtpNs=; b=PhvApm88c9BPILwoG4JsxG1wZ2ab+tFyWGc2tSsBgIDsvgJ+EeRyv25dbpRbQRvDzy rOVKrADmucNQ8pDuV1DlGofBlCdSJhkf57LXkscfcoWnfFuk9H4h3i1leXlBLVW3+leN nwlPE6qOSKqCJPUK2NwMh1qSG92DQ1qV8wWkb7w2c9i+H9tA+YWCSRqeym2dbW1DFrh6 fk1pbIiglpWfPYVk/hzWRyWMV8S993owvxcclzbR+eEcdIrTUDAPz2MUPwBvfX3nyEeQ P5fHWuFWF/sZ6hpKbMQsZR9p5pz3NrG3hsL6GzRt7Kz5UePXfpcZqWwlio9K7NFbRMFr BSww== X-Gm-Message-State: AAQBX9cRDg41fp/dmrBh4a+ctn1qu/C8r6+6Rg0YOHi/GAvk7MTIxN3L vKELjC1it8xP0tp7xU3z7ksIfoFBOE3KZHcXWis= X-Google-Smtp-Source: AKy350YsrxU40oWqHy+DBGs3eW8EOyRKYB+MLPSsDF9EOtqzCn2NfOvwv7g52bXoTJMyBnN5rbB1usgt2rAo0V1gR/s= X-Received: by 2002:a05:6512:1043:b0:4e8:6261:7dd0 with SMTP id c3-20020a056512104300b004e862617dd0mr4738018lfb.4.1681463396852; Fri, 14 Apr 2023 02:09:56 -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:09:44 +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=-0.9 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 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 Gc= c-patches > >>>> wrote: > >>>>> > >>>>> > >>>>> > >>> > >>> But that's not it, I've been looking at it, and there is code in pla= ce > >>> that does what I expected which is defer the choice of vectype for s= imd > >>> 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 have = 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 ne= ed > > 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 depends > > on the simdlen) to choose the vf because the choice of simdlend depend= s > > 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 bitrotte= d). 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 quote= : > >> > >>> 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. > >>> /* 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