From patchwork Tue Nov 14 11:59:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 164876 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp1805786vqg; Tue, 14 Nov 2023 03:59:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IERj7S0Z3CkkGZd2uV+6ucGimSegn765wC4sIjeqY5U4G0XcBdDQKDBZWIWg16nFG/xJSqt X-Received: by 2002:a05:620a:258b:b0:77b:e2ae:934c with SMTP id x11-20020a05620a258b00b0077be2ae934cmr2239144qko.12.1699963181583; Tue, 14 Nov 2023 03:59:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699963181; cv=pass; d=google.com; s=arc-20160816; b=YYAIwhEgShVEK8PiS4und1ugUQ5eA28neoN3wgcR+o4SxaKIgAuyl3XfB9SBb2XLDA fz5Jc/YhZOkadXPeyghrYBLqugft3Q/UEBSeJRF+JOpGzJ2TFzLH2jVaBvRl18c8A3p3 EfcW9ZdRmwCPlPJAHBbK8cVXUi7JC40VH/+XW+18nx1fBJ4MXr8nZd875GOrTTxes/l+ rKVw+SQ4XleMw5nY2iYYIvzyzgZ3Y/U1652hBi7gxCx+ynvgBeQKJQR4Su+oS5fVz+8n PfwFXB/I+XucDYDm3rPAi6bjWGQRrQqCV6y8xfg2UFm220rrXhO8x8wszUYz/vFUQOxI JYVQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:errors-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:mime-version :user-agent:subject:to:from:date:dkim-signature:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=JXW5GaOuwQM8HY1NMjM7UqNWRjsPCLrEO2hQ4t4wPgY=; fh=hPrbWPhweUx4V0GV9uXJqbyAzg2ABmTz7kczrAQqMmM=; b=HKLnU9az7D7fJOkV8nNapPSYqFzXesXkCGEsdtqcLBg35ym5TNBW7Y3Rk5g6FHMUP9 OevItMD5C+dlh6zrYIDCURkzSHgbP38mXpbfZB76PoPtLU6ySLwOIfo0gQmPCjFZBqx2 vh19QCDvIK95nH/V1ZlfqxDDXWam8mCOCTfNspgR49/9RK/ejXGZjXiyU80XXPYefitI Xfuc1UnfkrAVNnfobeCzYCsrEvVhWwtAcAzJV4fJJD4cvg0AaAflW8NKCa3tzJ/zjco1 ZPpIyPJgsSzP2+HCYUUzg6CfCyTxDyY9ihk1GU2l6uMhfBb7Lr5xKA/PE31sy6FMwHu4 a5sw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Te2cIDkV; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=tSe35qiD; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id q19-20020a05620a0d9300b0076f39f669desi6903864qkl.51.2023.11.14.03.59.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 03:59:41 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Te2cIDkV; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=tSe35qiD; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5B7D13856DE7 for ; Tue, 14 Nov 2023 11:59:41 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id 4D15E385841E for ; Tue, 14 Nov 2023 11:59:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4D15E385841E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4D15E385841E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:67c:2178:6::1c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699963159; cv=none; b=GaOw0trc+gPvz/02UBWrajPDin3aJ3Q5pJiEVdxb6+Ret7i+dm+1TI4VH9ISIQq7x9p1s55mkOW+FHgkSdKY1+eqt2cWEpR3YFki/lVGJsWphRk6hn7VB+dOWjlZDHUPEglAZmssS6f5kbodqojXuLwdjwu0t+EgLWz4YB9k/gA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699963159; c=relaxed/simple; bh=dlwOdbOiaywjghCFwgNiBPRxknoEf/5jxmLCRlzJ4C0=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:MIME-Version; b=LcC3JixhbtNAj72lNQX1J1TU57C/acIIW8lfYAf+P3atO0thlM8VmXy+Rjt7+6lOnodzvu0mP6J6VLIqiCpskTGQUBsBRjhwRYD6m/mAyCSW8Q0XRP8i+MR1mAtBv6Swqhv4WjZ47rly01qGrcofVrZzRs2rZJOIV6T2hZD8atI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 003FE218D6 for ; Tue, 14 Nov 2023 11:59:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1699963156; h=from:from:reply-to:date:date:to:to:cc:mime-version:mime-version: content-type:content-type; bh=JXW5GaOuwQM8HY1NMjM7UqNWRjsPCLrEO2hQ4t4wPgY=; b=Te2cIDkVdQa5Vmf+aOqbugCp7xn6xhkEmnGh8EACREMl0LUXJbEOh3OxuDhXTj1np5/fWa QzueLTQjHlHUmLpaVS4iVNOWXCe3OdnokPkO3Gs6Br0xctgt87FjKR+oriG5Z7BaE3VS6B FlaZkVIIuJ0437hVGznZTwBJA0Mgb7A= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1699963156; h=from:from:reply-to:date:date:to:to:cc:mime-version:mime-version: content-type:content-type; bh=JXW5GaOuwQM8HY1NMjM7UqNWRjsPCLrEO2hQ4t4wPgY=; b=tSe35qiDp78yzc+WU33EsIvYyaPZ6/pBg7Gx/GQMAvEKpW0PbrnQNoM3ex+ogVY+qF/YKZ dhhZ+WomJMEY9UCA== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (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 D74D42C161 for ; Tue, 14 Nov 2023 11:59:16 +0000 (UTC) Date: Tue, 14 Nov 2023 11:59:16 +0000 (UTC) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] Loop distribution fix for SCC detection User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 X-Spam-Level: X-Spamd-Bar: / Authentication-Results: smtp-out1.suse.de; dkim=none; dmarc=none; spf=softfail (smtp-out1.suse.de: 149.44.160.134 is neither permitted nor denied by domain of rguenther@suse.de) smtp.mailfrom=rguenther@suse.de X-Rspamd-Server: rspamd2 X-Spamd-Result: default: False [-0.01 / 50.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[149.44.160.134:from]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-3.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[gcc-patches@gcc.gnu.org]; TO_DN_NONE(0.00)[]; R_SPF_SOFTFAIL(0.60)[~all:c]; RCPT_COUNT_ONE(0.00)[1]; MISSING_MID(2.50)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; MX_GOOD(-0.01)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_NA(0.20)[suse.de]; VIOLATED_DIRECT_SPF(3.50)[]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.20)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; BAYES_HAM(-3.00)[99.99%] X-Spam-Score: -0.01 X-Rspamd-Queue-Id: 003FE218D6 X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, MISSING_MID, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Message-Id: <20231114115941.5B7D13856DE7@sourceware.org> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782540592931721694 X-GMAIL-MSGID: 1782540592931721694 The following adjusts data_dep_in_cycle_p to properly consider the whole loop nest when looking for data dep cycles and exempting zero-distance DDRs instead of just the outermost loop. Bootstrap & regtest running on x86_64-unknown-linux-gnu. * tree-loop-distribution.cc (loop_distribution::data_dep_in_cycle_p): Consider all loops in the nest when looking for lambda_vector_zerop. --- gcc/tree-loop-distribution.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/tree-loop-distribution.cc b/gcc/tree-loop-distribution.cc index 8e92af61c57..5ededd97c3d 100644 --- a/gcc/tree-loop-distribution.cc +++ b/gcc/tree-loop-distribution.cc @@ -1440,7 +1440,7 @@ loop_distribution::data_dep_in_cycle_p (struct graph *rdg, else if (DDR_NUM_DIST_VECTS (ddr) > 1) return true; else if (DDR_REVERSED_P (ddr) - || lambda_vector_zerop (DDR_DIST_VECT (ddr, 0), 1)) + || lambda_vector_zerop (DDR_DIST_VECT (ddr, 0), DDR_NB_LOOPS (ddr))) return false; return true;