From patchwork Sat Apr 22 22:09:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 8564 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1911397vqo; Sat, 22 Apr 2023 15:11:18 -0700 (PDT) X-Google-Smtp-Source: AKy350YLUDUmfuVE1+xWzZfGM+SsvDKkcyD4pWqP/25XoxZcKJJLT7yN24fXECCG4i5qyVIET855 X-Received: by 2002:aa7:da41:0:b0:506:8660:77a3 with SMTP id w1-20020aa7da41000000b00506866077a3mr9004974eds.37.1682201478696; Sat, 22 Apr 2023 15:11:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682201478; cv=none; d=google.com; s=arc-20160816; b=w86u7dyY2AhGpgL+kbaEz0LBCdi3emuuMAnHBjUX4oyKCyjM1O6RPeAxxJGFYP9gH3 a78Z8zZg9Gc0xPJSjptuwC6VD98ud5YpQPAuYez/Ay5GE8rc1rvLEih6D9CAYaETwOFQ QqTG3VJ14vQiERXTD+cc4IMCSOR0iCPswzzbA5iocIQmE52tAdZnKw8WiL3JB8S8u5kR vO0FLnhZjvuvNmfJaW5u3YLvkIuwZlp7cL3OJgsprBDdhPkLgq8+s5ZWfvpfYlDjy7Xb SsAHMp8tY2gjVfL1PX1bPesvwvwaw0DyFPpPcYYZCO3D1P0btK4zgxXeEVbrimLu+mzo 3b4Q== 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:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=3aMYjI326/+FEgLRRDaxM8KF5+AQe4rt1RHKMJnvTjY=; b=VEKaerxwvEQbd9CRxD8vE5H5JovbSr17TDeAdnrCbuAnqcd3En8RZn0ZzFIQY5U9xg Q098sqFXTNpIEB6PMAvqpKLNibm28lKUgCWCxwBMwcqK5yNjHRN4D/4W8CnC1A0XwOk2 WyiIaW9r1Rmn7vWaGxr4QEOLS07hNXbF+6fjM0Z+IKgw5MOpxXJ7EVz28I4ZcNRH2NPR CZUNDYm/jZXCZ763QTO4B6UUfdeqef7p/qXqPQgSQmZHJ06lMLiwdyaMdkfh8ntOVFwF 0V7huMc28gD5Mrg8A67Vf8uLu2gHBZsmj7e8Evxwu2lbnRcnsLk4RMAjKyYniMBCzmFh TIwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=gYaI+DtJ; 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 ka22-20020a170907991600b0094f93169acdsi5914051ejc.181.2023.04.22.15.11.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Apr 2023 15:11:18 -0700 (PDT) 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=gYaI+DtJ; 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 1375D385770D for ; Sat, 22 Apr 2023 22:10:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1375D385770D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682201430; bh=3aMYjI326/+FEgLRRDaxM8KF5+AQe4rt1RHKMJnvTjY=; h=To:CC:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=gYaI+DtJKYgoHy6YhkwiXP/kXlffG5UF3A4V3zcETMBXVgtZuFZgA0n7p1f/PDT8J rrNpd5HlUwX3N5iZ5+mz0pTewSu+hE0t9v2/h/D0FuiIjiZzh2HU4QfA3Cs6K7d2WJ FXwN3uu8LPCYPGNb25CjKqFxPXL3CNBUXHUq/o+4= 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 83F083858C50 for ; Sat, 22 Apr 2023 22:09:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 83F083858C50 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 33MLGWq7006595 for ; Sat, 22 Apr 2023 15:09:43 -0700 Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3q4egjhp9y-1 (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 AC56B3F708D; Sat, 22 Apr 2023 15:09:29 -0700 (PDT) To: CC: Andrew Pinski Subject: [PATCH 0/6] Improve PHIOPT match and simplify for diamond shaped bbs Date: Sat, 22 Apr 2023 15:09:15 -0700 Message-ID: <20230422220921.452264-1-apinski@marvell.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: P0Jmcae3iKxsiQr8Q4FJDyrMSzsXPnaS X-Proofpoint-GUID: P0Jmcae3iKxsiQr8Q4FJDyrMSzsXPnaS 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=-8.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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?1763916098011513386?= X-GMAIL-MSGID: =?utf-8?q?1763916098011513386?= This set of patches implement match and simplify for diamond shaped bbs. Right now there are no match-and-simplify patterns which take advantages of this directly. Though predicates can cause a diamond shaped bb to show up in phiopt1 even though the BB is empty. This allows for that and fixes phi-opt-23.c/phi-opt-24.c testcases. Andrew Pinski (6): PHIOPT: Move check on diamond bb to tree_ssa_phiopt_worker from minmax_replacement PHIOPT: Cleanup tree_ssa_phiopt_worker code PHIOPT: Allow other diamond uses when do_hoist_loads is true PHIOPT: Factor out some code from match_simplify_replacement PHIOPT: Ignore predicates for match-and-simplify phi-opt PHIOPT: Add support for diamond shaped bb to match_simplify_replacement gcc/testsuite/gcc.dg/tree-ssa/phi-opt-23.c | 4 +- gcc/testsuite/gcc.dg/tree-ssa/phi-opt-24.c | 4 +- .../gcc.dg/tree-ssa/ssa-ifcombine-13.c | 4 +- gcc/tree-ssa-phiopt.cc | 360 ++++++++++-------- 4 files changed, 218 insertions(+), 154 deletions(-)