From patchwork Wed Nov 9 13:50:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 17550 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp343524wru; Wed, 9 Nov 2022 05:51:29 -0800 (PST) X-Google-Smtp-Source: AMsMyM47GCtQKvckSHbvOSEDs5ydIa3SI2vU5YRBF0pgzt1pJGwDl8hoNyfZpnQBKr/pY7V7r2Ar X-Received: by 2002:aa7:d0c5:0:b0:464:39e1:68f8 with SMTP id u5-20020aa7d0c5000000b0046439e168f8mr32845364edo.34.1668001889318; Wed, 09 Nov 2022 05:51:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668001889; cv=none; d=google.com; s=arc-20160816; b=x++WICc/6SltRQztsUchZeIAYWlMu0Y3XewLBoui9bvP0dZ6vLLv6HFnv7mPsa4g9H epiSML4QU/ndAXlQoE7U6/t2wL1fjQXZR0m7sNnSORMH6hkeTJO2ujPgJsqKUqdZcm0W u9tNwsfSooZ3HVrWfdozjEaZ6fMOoo6GYw+Oiq/4XCs4yFfOboYUjdpFPcheU6FduXUQ fUtCvz5iLpp/S86MfakZ7+fyXUNVk5FDs4JQYepWgRbTwh2GPWyYdMMFw5MIkPBT3Vub FWXTCzjF5N0XICicXNmcCKiWApNnsScCrrl7a+b2R2/cMMpSzpi7pFb7FC3+3E1Vid/a 7mvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:message-id :mime-version:subject:to:date:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=qPSBXGGZItJsmWMf8OS3lWYpCi9nbVBD0Gwt5IvVAw4=; b=vDBD3FXQZSRBQKxY1qT4BpNoIgkNtvRFG52H01z2xHEyqzUtqBn2ofQo0nw3Qe2SJQ mYksyc1EdIY4uPow3tDj3zYpB3YXEAqBfvr9/vErExo+eWLWEWIqVovVa3OyyQYV7cvv m+k7B9h+lb/pPD2S+Ro2ghqH5rHKa424u7ynyLyv6eeEn8m5zd6XU/QHkZe62SzgQ3Ee DnuAVlvfTkgt3zRTvTkvhN+/mIc0hWZdZjRT40WBOMMEv+sa9jxRwfSc538YuthFNEiP +jdvYJJStD/BaXEDyHyWT89AHBh9vaMuSoWP+iCy6rW95/bTkxXgvvgYLYyz+8Ft/Z0o jy+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=xlGxrEpk; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id cr13-20020a170906d54d00b0078de83a052csi16110954ejc.483.2022.11.09.05.51.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 05:51:29 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=xlGxrEpk; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5E7773858C5E for ; Wed, 9 Nov 2022 13:51:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5E7773858C5E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668001888; bh=qPSBXGGZItJsmWMf8OS3lWYpCi9nbVBD0Gwt5IvVAw4=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=xlGxrEpkzYGn9z1sCwaIs1Q0q53RcRKMngRcOznQjf8mGLoulMPflHO85K74ByMLW mIuLuk9axZJn3unTIrXqbGT4IgsY1yt6WooDTgJT3xcj/QvB9RCcy7p3OEha/2QHCP lQIgRRRkEZb8W5uHc+QfdDUn/A5rUprWa0DBXqro= 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 [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id E243E3858D1E for ; Wed, 9 Nov 2022 13:50:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E243E3858D1E Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 2A8DC1FA3D for ; Wed, 9 Nov 2022 13:50:46 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 17EDE1331F for ; Wed, 9 Nov 2022 13:50:46 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Wsy4BDawa2MYFAAAMHmgww (envelope-from ) for ; Wed, 09 Nov 2022 13:50:46 +0000 Date: Wed, 9 Nov 2022 14:50:45 +0100 (CET) To: gcc-patches@gcc.gnu.org Subject: [PATCH] tree-optimization/84646 - remove premature thread path rejection MIME-Version: 1.0 Message-Id: <20221109135046.17EDE1331F@imap2.suse-dmz.suse.de> X-Spam-Status: No, score=-11.8 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.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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Richard Biener via Gcc-patches From: Richard Biener Reply-To: Richard Biener Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749026749339377288?= X-GMAIL-MSGID: =?utf-8?q?1749026749339377288?= This removes a premature rejection that's done later in a different way. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. PR tree-optimization/84646 * tree-ssa-threadbackward.cc (back_threader::maybe_register_path): Remove premature cycle rejection. --- gcc/tree-ssa-threadbackward.cc | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/gcc/tree-ssa-threadbackward.cc b/gcc/tree-ssa-threadbackward.cc index 2a8cfa3ee01..2290b95717d 100644 --- a/gcc/tree-ssa-threadbackward.cc +++ b/gcc/tree-ssa-threadbackward.cc @@ -249,25 +249,16 @@ back_threader::maybe_register_path (back_threader_profitability &profit) if (taken_edge && taken_edge != UNREACHABLE_EDGE) { - if (m_visited_bbs.contains (taken_edge->dest)) + bool irreducible = false; + if (profit.profitable_path_p (m_path, taken_edge, &irreducible) + && debug_counter () + && m_registry.register_path (m_path, taken_edge)) { - // Avoid circular paths by indicating there is nothing to - // see in this direction. - taken_edge = UNREACHABLE_EDGE; + if (irreducible) + vect_free_loop_info_assumptions (m_path[0]->loop_father); } else - { - bool irreducible = false; - if (profit.profitable_path_p (m_path, taken_edge, &irreducible) - && debug_counter () - && m_registry.register_path (m_path, taken_edge)) - { - if (irreducible) - vect_free_loop_info_assumptions (m_path[0]->loop_father); - } - else - taken_edge = NULL; - } + taken_edge = NULL; } if (dump_file && (dump_flags & TDF_DETAILS))