From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id D023C3857C48 for ; Thu, 7 Jan 2021 13:17:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D023C3857C48 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rguenther@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id E7C4AB717; Thu, 7 Jan 2021 13:17:37 +0000 (UTC) Date: Thu, 7 Jan 2021 14:17:37 +0100 (CET) From: Richard Biener To: Tamar Christina cc: gcc-patches@gcc.gnu.org, nd@arm.com, ook@ucw.cz Subject: Re: [PATCH 3/8 v9]middle-end slp: handle externals correctly in linear_loads_p In-Reply-To: <20201228133639.GA22403@arm.com> Message-ID: References: <20201228133639.GA22403@arm.com> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2021 13:17:40 -0000 On Mon, 28 Dec 2020, Tamar Christina wrote: > Hi All, > > This fixes a bug with externals and linear_loads_p where I forgot to save the > value before returning. > > It also fixes handling of nodes with multiple children on a non VEC_PERM node. > There the child iteration would already resolve the kind and the loads are All > expected to be the same if valid so just return one. > > Bootstrapped Regtested on aarch64-none-linux-gnu, x86_64-pc-linux-gnu > and no issues. > > Ok for master? OK. Richard. > Thanks, > Tamar > > gcc/ChangeLog: > > * tree-vect-slp-patterns.c (linear_loads_p): Fix externals. > > --- inline copy of patch -- > diff --git a/gcc/tree-vect-slp-patterns.c b/gcc/tree-vect-slp-patterns.c > index 7fd79d91c6ba4ccdbf361307a6105fb7e46aa961..235c0741c78b04f14725751ec399c0fdb32a0823 100644 > --- a/gcc/tree-vect-slp-patterns.c > +++ b/gcc/tree-vect-slp-patterns.c > @@ -229,6 +229,7 @@ linear_loads_p (slp_tree_to_load_perm_map_t *perm_cache, slp_tree root) > else if (SLP_TREE_DEF_TYPE (root) != vect_internal_def) > { > retval.first = PERM_TOP; > + perm_cache->put (root, retval); > return retval; > } > > @@ -241,6 +242,7 @@ linear_loads_p (slp_tree_to_load_perm_map_t *perm_cache, slp_tree root) > complex_load_perm_t res = linear_loads_p (perm_cache, child); > kind = vect_merge_perms (kind, res.first); > /* Unknown and Top are not valid on blends as they produce no permute. */ > + retval.first = kind; > if (kind == PERM_UNKNOWN || kind == PERM_TOP) > return retval; > all_loads.safe_push (res.second); > @@ -258,7 +260,7 @@ linear_loads_p (slp_tree_to_load_perm_map_t *perm_cache, slp_tree root) > retval.first = kind; > retval.second = nloads; > } > - else if (all_loads.length () == 1) > + else > { > retval.first = kind; > retval.second = all_loads[0]; > > > -- Richard Biener SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany; GF: Felix Imendörffer; HRB 36809 (AG Nuernberg)