From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by sourceware.org (Postfix) with ESMTPS id AE2FB3858C78 for ; Sat, 22 Apr 2023 22:09:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AE2FB3858C78 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=marvell.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=marvell.com 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 33MLGWq9006595 for ; Sat, 22 Apr 2023 15:09:43 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=t1tkkM7l+3H6sUhTxjiOg+MvroIu15OaF55mekNOJKw=; b=RcYQ6nNUVKdfYpuJIuyK6h2i/fUoSRulUlGsWrsS9KSbZ1g/xXZZFBPKEeCrTXy/nd6m EesmhTaDB0RcD7YuGGl8cvhIuh6AasWgt2HxXC0Dw/fWm6IWos40l8tGER5e0kxmxONP Fe8WAIbW4rgef521ruPBy7qRig4EHPyRuei+2MW+IBhQVxZG0lKmdXmHv0ykjeY5gTAK FqJkok3ze74gEyLr03E9GR0kM4YqBhH8Ptd2NO+KgHSDxo2gTUou4fYX4HmNdeo9H3B+ tEiaYBDMNCp1Bt5Sy+Qnc1ZOuhFFp8DxLIS7/2F2XNBPLQDpjJgZXGIjCFvppZGO5goE +w== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3q4egjhp9y-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Sat, 22 Apr 2023 15:09:43 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) 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:30 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Sat, 22 Apr 2023 15:09:30 -0700 Received: from vpnclient.wrightpinski.org.com (unknown [10.69.242.187]) by maili.marvell.com (Postfix) with ESMTP id 30D973F7090; Sat, 22 Apr 2023 15:09:30 -0700 (PDT) From: Andrew Pinski To: CC: Andrew Pinski Subject: [PATCH 1/6] PHIOPT: Move check on diamond bb to tree_ssa_phiopt_worker from minmax_replacement Date: Sat, 22 Apr 2023 15:09:16 -0700 Message-ID: <20230422220921.452264-2-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 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: eSDCWGaBSgPPCoGW8yrAfTXPgyxZrqgy X-Proofpoint-GUID: eSDCWGaBSgPPCoGW8yrAfTXPgyxZrqgy 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 List-Id: This moves the check to make sure on the diamond shaped form bbs that the the two middle bbs are only for that diamond shaped form earlier in the shared code. Also remove the redundant check for single_succ_p since that was already done before hand. The next patch will simplify the code even further and remove redundant checks. gcc/ChangeLog: * tree-ssa-phiopt.cc (tree_ssa_phiopt_worker): Move the diamond form check from ... (minmax_replacement): Here. --- gcc/tree-ssa-phiopt.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc index d886c88215b..296ba646e62 100644 --- a/gcc/tree-ssa-phiopt.cc +++ b/gcc/tree-ssa-phiopt.cc @@ -220,6 +220,14 @@ tree_ssa_phiopt_worker (bool do_store_elim, bool do_hoist_loads, bool early_p) continue; } + if (diamond_p) + { + if (!single_pred_p (bb1) + || !single_pred_p (bb2) + || !single_succ_p (bb2)) + continue; + } + if (do_store_elim && !diamond_p) { /* Also make sure that bb1 only have one predecessor and that it @@ -2032,12 +2040,6 @@ minmax_replacement (basic_block cond_bb, basic_block middle_bb, basic_block alt_ tree alt_lhs, alt_op0, alt_op1; bool invert = false; - if (!single_pred_p (middle_bb) - || !single_pred_p (alt_middle_bb) - || !single_succ_p (middle_bb) - || !single_succ_p (alt_middle_bb)) - return false; - /* When THREEWAY_P then e1 will point to the edge of the final transition from middle-bb to end. */ if (true_edge == e0) -- 2.39.1