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 1A12F3858D1E for ; Tue, 2 May 2023 23:14:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1A12F3858D1E 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 342K5fNk026446 for ; Tue, 2 May 2023 16:14:27 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=1TOXmfiwQXa41NDMl5+QoDrG8TxbjWvkv7fULuYztlc=; b=WLafwweMz1heWtuFsPPZajG76ZYxFxSm8x+9KZpjLBeTb0wxqKRozBAJSZZJGN2qzcVw Qm8UajYaCj7XLPqS5x4D7NBso3RD/IQYpXRUFZdFZ40WmutEl4shWI5oxeGu/5GYqqxr NOXUJLqEslirR1lfZsyZN1MGqHLXsAA0nJ89/YZXlkEzw7U856X4YEY84cjbyTyU3Vjx R0G913HI1d/sPBp5DqMW1xltlD6ZG0ump4GhWTzpKrZqQ3AuOzmadgEMdpOlaTgFD/LZ QrtFOUMGtA+LVh2/AjZJTrmUeOv2oR7P3cDP+KzFTmdNW2okD5iUmtNf8Ss0JxY02WR6 Eg== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3qavhem1c1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Tue, 02 May 2023 16:14:27 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Tue, 2 May 2023 16:14:26 -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; Tue, 2 May 2023 16:14:26 -0700 Received: from vpnclient.wrightpinski.org.com (unknown [10.69.242.187]) by maili.marvell.com (Postfix) with ESMTP id DE5963F705D; Tue, 2 May 2023 16:14:25 -0700 (PDT) From: Andrew Pinski To: CC: Andrew Pinski Subject: [PATCH] Add stats to simple_dce_from_worklist Date: Tue, 2 May 2023 16:14:17 -0700 Message-ID: <20230502231417.872953-1-apinski@marvell.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: nJ2BFpopo3BZcHXv_bGWCLrJTqW4QWsy X-Proofpoint-GUID: nJ2BFpopo3BZcHXv_bGWCLrJTqW4QWsy 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-05-02_12,2023-04-27_01,2023-02-09_01 X-Spam-Status: No, score=-14.6 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: While looking to move substitute_and_fold_engine over to use simple_dce_from_worklist, I noticed that we don't record the stats of the removed stmts/phis. So this does that. OK? Bootstrapped and tested on x86_64-linux-gnu. gcc/ChangeLog: * tree-ssa-dce.cc (simple_dce_from_worklist): Record stats on removed number of statements and phis. --- gcc/tree-ssa-dce.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gcc/tree-ssa-dce.cc b/gcc/tree-ssa-dce.cc index 1fd88e8ee37..86a33e1a40d 100644 --- a/gcc/tree-ssa-dce.cc +++ b/gcc/tree-ssa-dce.cc @@ -2099,6 +2099,8 @@ make_pass_cd_dce (gcc::context *ctxt) void simple_dce_from_worklist (bitmap worklist) { + long phiremoved = 0; + long stmtremoved = 0; while (! bitmap_empty_p (worklist)) { /* Pop item. */ @@ -2144,12 +2146,20 @@ simple_dce_from_worklist (bitmap worklist) } gimple_stmt_iterator gsi = gsi_for_stmt (t); if (gimple_code (t) == GIMPLE_PHI) - remove_phi_node (&gsi, true); + { + remove_phi_node (&gsi, true); + phiremoved++; + } else { unlink_stmt_vdef (t); gsi_remove (&gsi, true); release_defs (t); + stmtremoved++; } } + statistics_counter_event (cfun, "PHIs removed", + phiremoved); + statistics_counter_event (cfun, "Statements removed", + stmtremoved); } -- 2.39.1