From patchwork Fri Jun 11 11:35:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 1490915 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=AAfeThG0; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=XX5Qz42Z; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G1f116Fc1z9sX5 for ; Fri, 11 Jun 2021 21:35:48 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3C9B23AAB4BB for ; Fri, 11 Jun 2021 11:35:46 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id C35C83889826 for ; Fri, 11 Jun 2021 11:35:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C35C83889826 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 946811FD6C for ; Fri, 11 Jun 2021 11:35:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1623411322; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=lg/HEpXi9GfRRwwdTK+5E8/QV7x9PU+kKPb6DPdnxzk=; b=AAfeThG0fktX3/Xa2xfkrgxqeJiVvmBWGzOey/RBoNtJXh5LhcrGJGLvobVF9nW8ePolcp ds92hLts7XOVXFlU++kb8HmxNeRWct0BAdvofWd72uDcFvf/yGQmOnxwE1t4Dgm9XY9EsY K2fXl0CtTGtGLURrOttIzwbgosSf0O0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1623411322; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=lg/HEpXi9GfRRwwdTK+5E8/QV7x9PU+kKPb6DPdnxzk=; b=XX5Qz42ZJud1EqPd5IZh7/raU+TRXa4Nnp8tuOoiujMPiyrhKd+HIt9Q/bOXNdPFJ3R0Gh MjCpZm0jK59YlsBQ== Received: from [10.163.28.26] (unknown [10.163.28.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 839AEA3BBA for ; Fri, 11 Jun 2021 11:35:22 +0000 (UTC) Date: Fri, 11 Jun 2021 13:35:22 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] tree-optimization/101026 - fix SLP re-association Message-ID: <4r63sn87-pnn0-o884-q113-252p89no9s92@fhfr.qr> MIME-Version: 1.0 X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 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: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Since we cannot yet encode the operation in the SLP node itself but need a representative stmt require an existing one for now to avoid the need to build a fake GIMPLE stmt. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. 2021-06-11 Richard Biener PR tree-optimization/101026 * tree-vect-slp.c (vect_build_slp_tree_2): Make sure we have a representative for the associated chain nodes. * gfortran.dg/pr101026.f: New testcase. --- gcc/testsuite/gfortran.dg/pr101026.f | 11 +++++++++++ gcc/tree-vect-slp.c | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gfortran.dg/pr101026.f diff --git a/gcc/testsuite/gfortran.dg/pr101026.f b/gcc/testsuite/gfortran.dg/pr101026.f new file mode 100644 index 00000000000..9576d8802ca --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr101026.f @@ -0,0 +1,11 @@ +! { dg-do compile } +! { dg-options "-Ofast -frounding-math" } + SUBROUTINE PASSB4 (CC,CH) + DIMENSION CC(IDO,4,L1), CH(IDO,L1,*) + DO 103 I=2,IDO,2 + TI4 = CC0-CC(I,4,K) + CI4 = TI1-TI4 + CH(I-1,K,4) = CI4 + CH(I,K,4) = CI4 + 103 CONTINUE + END diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index 6237a61ffd4..897bd6f37b9 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -1860,7 +1860,9 @@ vect_build_slp_tree_2 (vec_info *vinfo, slp_tree node, chains.quick_push (chain.copy ()); chain.truncate (0); } - if (chains.length () == group_size) + if (chains.length () == group_size + /* We cannot yet use SLP_TREE_CODE to communicate the operation. */ + && op_stmt_info) { /* Now we have a set of chains with the same length. */ /* 1. pre-sort according to def_type and operation. */