From patchwork Sun Jul 28 04:40:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 1965702 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=ITCi/CO2; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WWpjZ4JPsz1ybX for ; Sun, 28 Jul 2024 14:41:35 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7AAEA385841C for ; Sun, 28 Jul 2024 04:41:33 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by sourceware.org (Postfix) with ESMTPS id 2D7DC3858D28 for ; Sun, 28 Jul 2024 04:41:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2D7DC3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=quicinc.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2D7DC3858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722141672; cv=none; b=iH8nA+e8xk8NKP8bQdXilU7YMr4RWgYlglO0nJhW7IiYGWAuBQ4uURgnPIVbD5bqbs1tpczxNGeOaw7+PwAXZ/K5SWe1mnZslXfZPVdp0N8nGMDc5QtvDoKCm6uyVbK4xfZnLx1J4Z6fSXS15Kc51mVmak66t4UvY7qSLLYwqkc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722141672; c=relaxed/simple; bh=/EFtCvVmyf7944eCmwbGm4DqgZDgVPmJbD2pQK50BfI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=IaYBa1+4wpwyWqI+vicrnS4vEzBmWN8ATdci0d7AwxTE4Z0c7zJA05/XBky9vdsdj4A28Cv3yYMJ0XKFBehzX62YTwV9Z5B7CsKUeFYgwJ+9LYdQI7o4OQNciIDwWxFjU28+GLIECWYim7RmF+PW0jL1NSVievF46SvDVz22MgI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46S3r6tt017801 for ; Sun, 28 Jul 2024 04:41:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=qcppdkim1; bh=jxOCTLYCnNA+940QwT/YOY /xZH216pSFzzZRM+nrmtI=; b=ITCi/CO2oqrWheB0XV8W5oSiepFocWRj2lPTno 4Cx5o7oRy00hIZXJZ/WK4sVulVfp9I8LEiSxLQztlLiiRTVGw20x6H6HKegdUKZS LvVIpoXU2yLeyE3dXscdGnjTQ+e0y4d9FmkofLs6JB9DSYUo19WdxdcfNxo8JszB XUX8UAlqKp5Ua/uK8vOlBdioxb56nwng6Y/viAkRZU5N9E8kLZIXG2oObTHi+jTz oOVJS9vW1kfnF0u2xlNV/TAflGX2ncFJf+mZKNvO/X3Lx5eP2Cf9GXZIGY98PK7g bO3bCtGHb31fG5BRwLV9EjdZtc/KnlEeytSUVmHRsAg4vOOw== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 40ms96hdp7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 28 Jul 2024 04:41:10 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA01.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 46S4f9O2008691 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 28 Jul 2024 04:41:09 GMT Received: from hu-apinski-lv.qualcomm.com (10.49.16.6) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Sat, 27 Jul 2024 21:41:09 -0700 From: Andrew Pinski To: CC: Andrew Pinski Subject: [PATCH 1/2] middle-end: Remove PROP_no_crit_edges [PR116114] Date: Sat, 27 Jul 2024 21:40:57 -0700 Message-ID: <20240728044058.1141160-1-quic_apinski@quicinc.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01b.na.qualcomm.com (10.47.209.197) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: s0mlPF7NBU8GqVMZRM2bEp8V_as_ENvx X-Proofpoint-GUID: s0mlPF7NBU8GqVMZRM2bEp8V_as_ENvx X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-28_02,2024-07-26_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 impostorscore=0 mlxlogscore=999 bulkscore=0 malwarescore=0 phishscore=0 priorityscore=1501 clxscore=1015 lowpriorityscore=0 spamscore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2407280032 X-Spam-Status: No, score=-13.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_NONE, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org PROP_no_crit_edges was made checked by r8-2993-ga7976089dba5e2 by doing an explict splitting critical edges directly in PRE. So let's remove it. Bootstrapped and tested on x86_64-linux-gnu with no regressions. Note this depends on https://gcc.gnu.org/pipermail/gcc-patches/2024-July/658447.html . gcc/ChangeLog: PR middle-end/116114 * function.h (PROP_no_crit_edges): Delete. * passes.cc (dump_properties): Remove testing of PROP_no_crit_edges * tree-cfg.cc (pass_data_split_crit_edges): Don't set PROP_no_crit_edges for properties provided. * tree-ssa-sink.cc (pass_data_sink_code): Remove comment about PROP_no_crit_edges. Signed-off-by: Andrew Pinski --- gcc/function.h | 2 +- gcc/passes.cc | 2 -- gcc/tree-cfg.cc | 2 +- gcc/tree-ssa-sink.cc | 2 -- 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/gcc/function.h b/gcc/function.h index c2c1b808eb1..f0f48648504 100644 --- a/gcc/function.h +++ b/gcc/function.h @@ -251,7 +251,7 @@ public: #define PROP_cfg (1 << 3) #define PROP_objsz (1 << 4) /* object sizes computed */ #define PROP_ssa (1 << 5) -#define PROP_no_crit_edges (1 << 6) +/* UNUSED (1 << 6) */ #define PROP_rtl (1 << 7) #define PROP_gimple_lomp (1 << 8) /* lowered OpenMP directives */ #define PROP_cfglayout (1 << 9) /* cfglayout mode on RTL */ diff --git a/gcc/passes.cc b/gcc/passes.cc index bf91befe074..c494c76808b 100644 --- a/gcc/passes.cc +++ b/gcc/passes.cc @@ -3178,8 +3178,6 @@ dump_properties (FILE *dump, unsigned int props) fprintf (dump, "PROP_cfg\n"); if (props & PROP_ssa) fprintf (dump, "PROP_ssa\n"); - if (props & PROP_no_crit_edges) - fprintf (dump, "PROP_no_crit_edges\n"); if (props & PROP_rtl) fprintf (dump, "PROP_rtl\n"); if (props & PROP_gimple_lomp) diff --git a/gcc/tree-cfg.cc b/gcc/tree-cfg.cc index 32b0d3b356e..3b0c7c4ba53 100644 --- a/gcc/tree-cfg.cc +++ b/gcc/tree-cfg.cc @@ -9495,7 +9495,7 @@ const pass_data pass_data_split_crit_edges = OPTGROUP_NONE, /* optinfo_flags */ TV_TREE_SPLIT_EDGES, /* tv_id */ PROP_cfg, /* properties_required */ - PROP_no_crit_edges, /* properties_provided */ + 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ 0, /* todo_flags_finish */ diff --git a/gcc/tree-ssa-sink.cc b/gcc/tree-ssa-sink.cc index 737638591db..ad5dd83e43d 100644 --- a/gcc/tree-ssa-sink.cc +++ b/gcc/tree-ssa-sink.cc @@ -799,8 +799,6 @@ const pass_data pass_data_sink_code = "sink", /* name */ OPTGROUP_NONE, /* optinfo_flags */ TV_TREE_SINK, /* tv_id */ - /* PROP_no_crit_edges is ensured by running split_edges_for_insertion in - pass_data_sink_code::execute (). */ ( PROP_cfg | PROP_ssa ), /* properties_required */ 0, /* properties_provided */ 0, /* properties_destroyed */ From patchwork Sun Jul 28 04:40:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 1965703 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=aKSm1z+U; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WWpjb0xxYz20Fr for ; Sun, 28 Jul 2024 14:41:39 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7EBC03858430 for ; Sun, 28 Jul 2024 04:41:36 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by sourceware.org (Postfix) with ESMTPS id 9DB7D3858CDB for ; Sun, 28 Jul 2024 04:41:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9DB7D3858CDB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=quicinc.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9DB7D3858CDB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722141673; cv=none; b=i4RdfGAvwkRt0EQXH2Zf9Vx0Zsz/OAzjRueDBiqG2Gm0LgCHXHrTslmBMDCFQ0m3tlzj8NXzpSO+fpYXWPUMAchhK8R/JP1TD36dxCujxqAmIWc2A3OTs5EONyQnCdfUt70qy9jW8/IDE1LWtWzM3yVgwZHaxa5y5lzFMlbo6Tc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722141673; c=relaxed/simple; bh=5QW1w05NZVmKdO54zZkMPKVbx8eZXAg1zJg6qYl1230=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ecTqgXfJrCmg5JeufTcxWFzn7O2yM1nietgibcy1X8giuE4GoM9khY7dJOilX8x3twn3CHlzx8n0YXeDh44UvI3z1bndO1hNXIKG0VrkRatKEI4e/qlQTus8TWNrD/HFZLX5eWatYh4Uoqq5EJvg56fl5w7Vebq9II9AtpW0J0g= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46S4c1bJ022951 for ; Sun, 28 Jul 2024 04:41:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= cpmsZCayQ4eAGeXqxxSJu0AJsn8Bvnv1dlr0RT51oD8=; b=aKSm1z+UE6ooKB21 NrC2Z33mJHMxftUnAbl+jqpWWN806lZN4X0F7+TVO6pMCsXFhOB6CffGLgoF3AuY xHJeJJwMyNxmaXlltBHsX+SqEVNJNiG3qwYZZn+AJp1MtFhT2qb97wtYO6YfV0PY 6juyOY/kW6mEODCC2nWJyhqofWHaduMHbKDIGqETh8WQxaBTxC+5YAHXMY5Hmoc1 qH11qalrgZJTlu6QXm8Du3Fl5HWfE5OvWV6wBOFhs02f9HCTGVAA/BoTmIV6qQCS fhrSmtZUPdN25COGGAdka8+wXWtZuhag4E4jR50jtNCU5JGXwi+bZcDjg3VRQFbK 6Y0yZQ== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 40mqurhgkn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 28 Jul 2024 04:41:10 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA04.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 46S4f9Ap013262 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 28 Jul 2024 04:41:09 GMT Received: from hu-apinski-lv.qualcomm.com (10.49.16.6) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Sat, 27 Jul 2024 21:41:09 -0700 From: Andrew Pinski To: CC: Andrew Pinski Subject: [PATCH 2/2] middle-end: Move the function current properties over to a .def file [PR116118] Date: Sat, 27 Jul 2024 21:40:58 -0700 Message-ID: <20240728044058.1141160-2-quic_apinski@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240728044058.1141160-1-quic_apinski@quicinc.com> References: <20240728044058.1141160-1-quic_apinski@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01b.na.qualcomm.com (10.47.209.197) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 7tgz-EbLqk7_Lij5DXduENY1hQJeHUvg X-Proofpoint-ORIG-GUID: 7tgz-EbLqk7_Lij5DXduENY1hQJeHUvg X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-28_02,2024-07-26_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 mlxlogscore=999 spamscore=0 phishscore=0 lowpriorityscore=0 adultscore=0 clxscore=1015 bulkscore=0 malwarescore=0 mlxscore=0 impostorscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2407280033 X-Spam-Status: No, score=-13.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_NONE, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org While doing some other cleanups with the properties I noticed that debug_properties was not updated for some of the new properties. So instead of just updating the function, this moves the properties over to its own .def file so we don't need to update this nor will have a conflict in the bit ordering either. For now I just used an `enum class` for the enum that holds the bit number of each property. Later on this might be changed to a normal enum and only use that instead. But that won't be until we require C++17 since `folding expressions` make this code much simplier. Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: PR middle-end/116118 * function.h (PROP_bitnum): New enum class. (function_prop_type): New typedef. (PROP_gimple_any): Remove. (PROP_gimple_lcf): Remove. (PROP_gimple_leh): Remove. (PROP_cfg): Remove. (PROP_objsz): Remove. (PROP_ssa): Remove. (PROP_rtl): Remove. (PROP_gimple_lomp): Remove. (PROP_cfglayout): Remove. (PROP_gimple_lcx): Remove. (PROP_loops): Remove. (PROP_gimple_lvec): Remove. (PROP_gimple_eomp): Remove. (PROP_gimple_lva): Remove. (PROP_gimple_opt_math): Remove. (PROP_gimple_lomp_dev): Remove. (PROP_rtl_split_insns): Remove. (PROP_loop_opts_done): Remove. (PROP_assumptions_done): Remove. (PROP_gimple_lbitint): Remove. (enum PROP_bit): New. (struct function): Use function_prop_type instead of `unsigned int` for the properties. * passes.cc (debug_properties): Update to use function_prop_type. (dump_properties): Likewise. Also don't directly print the properties, use an array. * ir-prop.def: New file. Signed-off-by: Andrew Pinski --- gcc/function.h | 47 ++++++++++++++++++++--------------------------- gcc/ir-prop.def | 45 +++++++++++++++++++++++++++++++++++++++++++++ gcc/passes.cc | 45 +++++++++++++++++++-------------------------- 3 files changed, 84 insertions(+), 53 deletions(-) create mode 100644 gcc/ir-prop.def diff --git a/gcc/function.h b/gcc/function.h index f0f48648504..9a678741f6c 100644 --- a/gcc/function.h +++ b/gcc/function.h @@ -243,34 +243,27 @@ public: (current_function_dynamic_stack_size != 0 \ || current_function_has_unbounded_dynamic_stack_size) +/* Pass properties set on function::curr_properties. */ +enum class PROP_bitnum +{ +#define PROP(a) PROP_BIT_##a , +#include "ir-prop.def" +PROP_BIT_end +}; + +typedef unsigned int function_prop_type; +/* Make sure current_properties has enough bits for the properties. */ +static_assert ((size_t)PROP_bitnum::PROP_BIT_end + <= (sizeof(function_prop_type) * CHAR_BIT), + "too many properties for prop type"); /* Pass properties set on function::curr_properties. */ -#define PROP_gimple_any (1 << 0) /* entire gimple grammar */ -#define PROP_gimple_lcf (1 << 1) /* lowered control flow */ -#define PROP_gimple_leh (1 << 2) /* lowered eh */ -#define PROP_cfg (1 << 3) -#define PROP_objsz (1 << 4) /* object sizes computed */ -#define PROP_ssa (1 << 5) -/* UNUSED (1 << 6) */ -#define PROP_rtl (1 << 7) -#define PROP_gimple_lomp (1 << 8) /* lowered OpenMP directives */ -#define PROP_cfglayout (1 << 9) /* cfglayout mode on RTL */ -#define PROP_gimple_lcx (1 << 10) /* lowered complex */ -#define PROP_loops (1 << 11) /* preserve loop structures */ -#define PROP_gimple_lvec (1 << 12) /* lowered vector */ -#define PROP_gimple_eomp (1 << 13) /* no OpenMP directives */ -#define PROP_gimple_lva (1 << 14) /* No va_arg internal function. */ -#define PROP_gimple_opt_math (1 << 15) /* Disable canonicalization - of math functions; the - current choices have - been optimized. */ -#define PROP_gimple_lomp_dev (1 << 16) /* done omp_device_lower */ -#define PROP_rtl_split_insns (1 << 17) /* RTL has insns split. */ -#define PROP_loop_opts_done (1 << 18) /* SSA loop optimizations - have completed. */ -#define PROP_assumptions_done (1 << 19) /* Assume function kept - around. */ -#define PROP_gimple_lbitint (1 << 20) /* lowered large _BitInt */ +enum PROP_bit : function_prop_type +{ +#define PROP(a) PROP_##a = \ + ((function_prop_type)1) << (function_prop_type)PROP_bitnum::PROP_BIT_##a, +#include "ir-prop.def" +}; #define PROP_gimple \ (PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh | PROP_gimple_lomp) @@ -364,7 +357,7 @@ struct GTY(()) function { location_t function_end_locus; /* Properties used by the pass manager. */ - unsigned int curr_properties; + function_prop_type curr_properties; unsigned int last_verified; /* Different from normal TODO_flags which are handled right at the diff --git a/gcc/ir-prop.def b/gcc/ir-prop.def new file mode 100644 index 00000000000..7ec6d135a4e --- /dev/null +++ b/gcc/ir-prop.def @@ -0,0 +1,45 @@ +/* Pass properties set on function::curr_properties. + Copyright (C) 1989-2024 Free Software Foundation, Inc. + Copyright The GNU Toolchain Authors. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +/* PROP (name) defines the property that can be set on + function::curr_properties. */ +PROP (gimple_any) /* entire gimple grammar */ +PROP (gimple_lcf) /* lowered control flow */ +PROP (gimple_leh) /* lowered eh */ +PROP (cfg) +PROP (objsz) /* object sizes computed */ +PROP (ssa) +PROP (rtl) +PROP (gimple_lomp) /* lowered OpenMP directives */ +PROP (cfglayout) /* cfglayout mode on RTL */ +PROP (gimple_lcx) /* lowered complex */ +PROP (loops) /* preserve loop structures */ +PROP (gimple_lvec) /* lowered vector */ +PROP (gimple_eomp) /* no OpenMP directives */ +PROP (gimple_lva) /* No va_arg internal function. */ +PROP (gimple_opt_math) /* Disable canonicalization of math functions; the + current choices have been optimized. */ +PROP (gimple_lomp_dev) /* done omp_device_lower */ +PROP (rtl_split_insns) /* RTL has insns split. */ +PROP (loop_opts_done) /* SSA loop optimizations have completed. */ +PROP (assumptions_done) /* Assume function kept around. */ +PROP (gimple_lbitint) /* lowered large _BitInt */ + +#undef PROP diff --git a/gcc/passes.cc b/gcc/passes.cc index c494c76808b..1cfc505a24f 100644 --- a/gcc/passes.cc +++ b/gcc/passes.cc @@ -3161,39 +3161,32 @@ execute_all_ipa_stmt_fixups (struct cgraph_node *node, gimple **stmts) } -extern void debug_properties (unsigned int); -extern void dump_properties (FILE *, unsigned int); +extern void debug_properties (function_prop_type); +extern void dump_properties (FILE *, function_prop_type); DEBUG_FUNCTION void -dump_properties (FILE *dump, unsigned int props) +dump_properties (FILE *dump, function_prop_type props) { fprintf (dump, "Properties:\n"); - if (props & PROP_gimple_any) - fprintf (dump, "PROP_gimple_any\n"); - if (props & PROP_gimple_lcf) - fprintf (dump, "PROP_gimple_lcf\n"); - if (props & PROP_gimple_leh) - fprintf (dump, "PROP_gimple_leh\n"); - if (props & PROP_cfg) - fprintf (dump, "PROP_cfg\n"); - if (props & PROP_ssa) - fprintf (dump, "PROP_ssa\n"); - if (props & PROP_rtl) - fprintf (dump, "PROP_rtl\n"); - if (props & PROP_gimple_lomp) - fprintf (dump, "PROP_gimple_lomp\n"); - if (props & PROP_gimple_lomp_dev) - fprintf (dump, "PROP_gimple_lomp_dev\n"); - if (props & PROP_gimple_lcx) - fprintf (dump, "PROP_gimple_lcx\n"); - if (props & PROP_gimple_lvec) - fprintf (dump, "PROP_gimple_lvec\n"); - if (props & PROP_cfglayout) - fprintf (dump, "PROP_cfglayout\n"); + static const char *prop_name[] = { +#define PROP(a) "PROP_" #a , +#include "ir-prop.def" + }; + for (unsigned i = 0; i < (sizeof(function_prop_type) * CHAR_BIT); i++) + { + if ((props & (((function_prop_type)1) << i)) == 0) + continue; + if (i >= ARRAY_SIZE (prop_name)) + { + fprintf(dump, "unkown_prop: %d\n", i); + continue; + } + fprintf(dump, "%s\n", prop_name[i]); + } } DEBUG_FUNCTION void -debug_properties (unsigned int props) +debug_properties (function_prop_type props) { dump_properties (stderr, props); }