From patchwork Sat Apr 22 22:09:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 86643 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1912082vqo; Sat, 22 Apr 2023 15:13:27 -0700 (PDT) X-Google-Smtp-Source: AKy350YoGouAtPtfCHthx7MYawa1M3lyyd0z9L4XyKT4cgiPMvKVW301uN5969ghuAP341plWiBT X-Received: by 2002:aa7:c592:0:b0:508:3f08:ea0f with SMTP id g18-20020aa7c592000000b005083f08ea0fmr8337696edq.28.1682201606841; Sat, 22 Apr 2023 15:13:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682201606; cv=none; d=google.com; s=arc-20160816; b=ZUYLu69vYZhabmQ0+l0OqrmQZ80Y+klbIgR85ZD0qoUwi9YLzfKuy+qsrmO2OlEKNY JeF1yg/TDt5PicFiiHydJF3qBRiKyPNkBrpeXIMIDsamUUYmWDCiSAJo666YMA4NlIte /6kT2tDv3VagkJhfZ88LfbdUUmO0MqPfoANGETb3/+PWVBvGksPWQwWT4vd2lpLSohxN sfmIqr+nW2A/hhZ5nue1Uximw+pEQJFCtw8FHX+Q8AW4G+1tvyy4slsonR7rjATMRpDn DNrW3scbFDGZiM/XCf49WgniAvDX8OGFJDsm66XNyr9i+kV5ml61tP+Zcghxg6ED2iVZ FMHQ== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=U0UxIP8whi6dKflFbuI4GiwBkzqkEh9yppBHwYEuruk=; b=pJ8oa4D6D7em3AhvmzM7/WzUkjfpnoDpowQPwud5evGbCSZNV/LnbPYuFgJ5C45juY W4vysUFNMO7j1H1SHOjzir6pCrPrq/VKsQgQp8KqQcZiDnQDp9q4Vl9P6APhwx2TR/9A 9I23xYXfKDVN1T24XEWxoEZ6eoSquHoEPeV6EQ44RUnxSx4oz0S4Q62jdTcD4c84+nF+ KHdH8P6w7pLtvhVu4lLmzp5kwqvmo4P6MF1JLy4K1Vp+6ZzRY4iYoIkfrIc6z7qHXcu9 uKrHNmjPNUPtI+T9nu23rjyj+Vc2IRuQzRzwWmTioiF2Bn0uBdO02zYU1/AdU5WLWoxG vxKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=pcV6Oz73; 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=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id d23-20020a50fb17000000b005068cb68ed6si6140600edq.630.2023.04.22.15.13.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Apr 2023 15:13:26 -0700 (PDT) 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=@gcc.gnu.org header.s=default header.b=pcV6Oz73; 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=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 54055385558A for ; Sat, 22 Apr 2023 22:11:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 54055385558A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682201495; bh=U0UxIP8whi6dKflFbuI4GiwBkzqkEh9yppBHwYEuruk=; h=To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=pcV6Oz73chsOkzKSg4wdm8cR8U4WMP5DgSLaifcVJfAn5i0KBVDWgEXDySfFlLCxL G8w1Qpa4tymfMFZrcpGGbsdQpBt2nPvSOlSi1DgTwZ9/1294O9aGeOp/kazWT2O6HI QLnA2mA4UMf4C5nh8gymArQzTA4ixtq9hLwiAJ/U= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by sourceware.org (Postfix) with ESMTPS id 251CF3858C36 for ; Sat, 22 Apr 2023 22:09:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 251CF3858C36 Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33MLGWqB006595 for ; Sat, 22 Apr 2023 15:09:44 -0700 Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3q4egjhp9y-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Sat, 22 Apr 2023 15:09:44 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Sat, 22 Apr 2023 15:09:31 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Sat, 22 Apr 2023 15:09:31 -0700 Received: from vpnclient.wrightpinski.org.com (unknown [10.69.242.187]) by maili.marvell.com (Postfix) with ESMTP id 202AE3F708D; Sat, 22 Apr 2023 15:09:31 -0700 (PDT) To: CC: Andrew Pinski Subject: [PATCH 3/6] PHIOPT: Allow other diamond uses when do_hoist_loads is true Date: Sat, 22 Apr 2023 15:09:18 -0700 Message-ID: <20230422220921.452264-4-apinski@marvell.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230422220921.452264-1-apinski@marvell.com> References: <20230422220921.452264-1-apinski@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: yl72xDheU-o7YLmrIiCmPHiM07yQpzD- X-Proofpoint-GUID: yl72xDheU-o7YLmrIiCmPHiM07yQpzD- X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-22_15,2023-04-21_01,2023-02-09_01 X-Spam-Status: No, score=-14.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Andrew Pinski via Gcc-patches From: Andrew Pinski Reply-To: Andrew Pinski 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?1763916232318621394?= X-GMAIL-MSGID: =?utf-8?q?1763916232318621394?= While working on adding diamond shaped form to match-and-simplify phiopt, I Noticed that we would not reach there if do_hoist_loads was true. In the original code before the cleanups it was not obvious why but after I finished the cleanups, it was just a matter of removing a continue and that is what this patch does. This just happens also to fix a bug report that I noticed too. OK? Bootstrapped and tested on x86_64-linux-gnu. gcc/ChangeLog: PR tree-optimize/68894 * tree-ssa-phiopt.cc (tree_ssa_phiopt_worker): Remove the continue for the do_hoist_loads diamond case. --- gcc/tree-ssa-phiopt.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc index 05f19825ce9..e4062f33efa 100644 --- a/gcc/tree-ssa-phiopt.cc +++ b/gcc/tree-ssa-phiopt.cc @@ -243,10 +243,7 @@ tree_ssa_phiopt_worker (bool do_store_elim, bool do_hoist_loads, bool early_p) is likely to perform worse than the well-predicted branch. */ && !predictable_edge_p (EDGE_SUCC (bb, 0)) && !predictable_edge_p (EDGE_SUCC (bb, 1))) - { - hoist_adjacent_loads (bb, bb1, bb2, bb3); - continue; - } + hoist_adjacent_loads (bb, bb1, bb2, bb3); } gimple_stmt_iterator gsi;