From patchwork Mon Jul 1 21:46: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: 1954951 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=OCKBtYbi; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; 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 [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 4WCfn11j4rz1xqb for ; Tue, 2 Jul 2024 07:48:37 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7DF9D3882046 for ; Mon, 1 Jul 2024 21:48:35 +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 2524138708DA for ; Mon, 1 Jul 2024 21:47:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2524138708DA 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 2524138708DA 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=1719870433; cv=none; b=WiIh1EQTike/s0ODKYmyOwL4kBCO3XBdaK0AFlJaFY76YUnP/flcfI8dRBBlTDhMOisAKXFMwQZOr2V+RIYIZe/786qO5fMT+XzUwEOiPUTweMyeeqQBMPM5N58/DK0+UpJohXvGiD8xidIlob6kbjaq18gLN35laNCprjQp3xs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719870433; c=relaxed/simple; bh=yxKpBynkX+y80mh9saxSrS9Wg+Q+G2zOizh+qLO0/F8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=jjT3sVKeygmoLz8Ha2MpiXWPJSGx1UdRs9aZSPevrfKA9NhWmqaGZ/YPUoxhz1yLI+R0I0rWLCbOjM7a4RFoPDVK+Ld9+uU2QIXM25ThZnQlEyZNMSucUaApitljjYk+KKn9vyjoL2aZciA6gaZJrF0MuSboR9926VksayTZbIs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 461J8AtJ023893 for ; Mon, 1 Jul 2024 21:47: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= mV+MXRLMbdQq9MXgxpO58G/PJWz/59FXyxOp3U0TByw=; b=OCKBtYbitH9/n/4i NTgEqMMSpzFxpNXPHY7PGFZ/F1AsVR9m/6F2/CGES2839jbUMBmyLtHvq5Ds2bDn LxRTFkNKy3bAaQev52odPk4odYFdKgFtjWK7BXlb7HnDcdcm6jcJFbAvVlDypFXC bMC/YH5nzfgFngZuoD/cz7vFgrxFx3hlxEp/kQ9hpMi9XQgGHPVJu0RM+ORmqvmr pjqbVgxG6lYqUo2RJiLR+cQQwOldQZHgveMU9TKbCoE1J+wZ8yU7B3ROKePjLBti a/0TMCvcZk2EobixZeLKo/ZCkCQGl+BKSpMfgEORjfJBMattOI3UKol2OmFZGONo 5Xe7JQ== Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4027mnnrr1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 01 Jul 2024 21:47:10 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA05.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 461Ll9bY012650 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 1 Jul 2024 21:47:09 GMT Received: from hu-apinski-lv.qualcomm.com (10.80.80.8) 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; Mon, 1 Jul 2024 14:47:09 -0700 From: Andrew Pinski To: CC: Andrew Pinski Subject: [PATCH 4/4] Rename expand_powcabs pass to expand_pow Date: Mon, 1 Jul 2024 14:46:57 -0700 Message-ID: <20240701214657.3163066-5-quic_apinski@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701214657.3163066-1-quic_apinski@quicinc.com> References: <20240701214657.3163066-1-quic_apinski@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) 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: f_4gsopJbBwhk2LhKSl56EjN5FCscOG0 X-Proofpoint-GUID: f_4gsopJbBwhk2LhKSl56EjN5FCscOG0 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-01_21,2024-07-01_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 bulkscore=0 spamscore=0 malwarescore=0 adultscore=0 priorityscore=1501 lowpriorityscore=0 phishscore=0 mlxscore=0 suspectscore=0 clxscore=1011 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2407010162 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, 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 Since cabs expansion was removed from this pass, it would be good to rename it. Bootstrapped and tested on x86_64-linux-gnu gcc/ChangeLog: * passes.def (expand_pow): Renamed from expand_powcabs. * timevar.def (TV_TREE_POWCABS): Remove. (TV_TREE_POW): Add * tree-pass.h (make_pass_expand_powcabs): Rename to ... (make_pass_expand_pow): This. * tree-ssa-math-opts.cc (class pass_expand_powcabs): Rename to ... (class pass_expand_pow): This. (pass_expand_powcabs::execute): Rename to ... (pass_expand_pow::execute): This. (make_pass_expand_powcabs): Rename to ... (make_pass_expand_pow): This. gcc/testsuite/ChangeLog: * gcc.dg/pow-sqrt-synth-1.c: Update testcase for renamed pass. Signed-off-by: Andrew Pinski --- gcc/passes.def | 2 +- gcc/testsuite/gcc.dg/pow-sqrt-synth-1.c | 4 ++-- gcc/timevar.def | 2 +- gcc/tree-pass.h | 2 +- gcc/tree-ssa-math-opts.cc | 25 ++++++++++++------------- 5 files changed, 17 insertions(+), 18 deletions(-) diff --git a/gcc/passes.def b/gcc/passes.def index 13c9dc34ddf..b8c21b1e435 100644 --- a/gcc/passes.def +++ b/gcc/passes.def @@ -265,7 +265,7 @@ along with GCC; see the file COPYING3. If not see NEXT_PASS (pass_ccp, true /* nonzero_p */); /* After CCP we rewrite no longer addressed locals into SSA form if possible. */ - NEXT_PASS (pass_expand_powcabs); + NEXT_PASS (pass_expand_pow); NEXT_PASS (pass_optimize_bswap); NEXT_PASS (pass_laddress); NEXT_PASS (pass_lim); diff --git a/gcc/testsuite/gcc.dg/pow-sqrt-synth-1.c b/gcc/testsuite/gcc.dg/pow-sqrt-synth-1.c index 484b29a8fc8..be81e43ad9a 100644 --- a/gcc/testsuite/gcc.dg/pow-sqrt-synth-1.c +++ b/gcc/testsuite/gcc.dg/pow-sqrt-synth-1.c @@ -1,5 +1,5 @@ /* { dg-do compile { target sqrt_insn } } */ -/* { dg-options "-fdump-tree-powcabs -Ofast --param max-pow-sqrt-depth=8" } */ +/* { dg-options "-fdump-tree-pow -Ofast --param max-pow-sqrt-depth=8" } */ /* { dg-additional-options "-mfloat-abi=softfp -mfpu=neon-vfpv4" { target arm*-*-* } } */ double @@ -34,4 +34,4 @@ vecfoo (double *a) a[i] = __builtin_pow (a[i], 1.25); } -/* { dg-final { scan-tree-dump-times "synthesizing" 7 "powcabs" } } */ +/* { dg-final { scan-tree-dump-times "synthesizing" 7 "pow" } } */ diff --git a/gcc/timevar.def b/gcc/timevar.def index 6fc36859138..0f9d2c0b032 100644 --- a/gcc/timevar.def +++ b/gcc/timevar.def @@ -223,7 +223,7 @@ DEFTIMEVAR (TV_TREE_SWITCH_CONVERSION, "tree switch conversion") DEFTIMEVAR (TV_TREE_SWITCH_LOWERING, "tree switch lowering") DEFTIMEVAR (TV_TREE_RECIP , "gimple CSE reciprocals") DEFTIMEVAR (TV_TREE_SINCOS , "gimple CSE sin/cos") -DEFTIMEVAR (TV_TREE_POWCABS , "gimple expand pow/cabs") +DEFTIMEVAR (TV_TREE_POW , "gimple expand pow") DEFTIMEVAR (TV_TREE_WIDEN_MUL , "gimple widening/fma detection") DEFTIMEVAR (TV_TRANS_MEM , "transactional memory") DEFTIMEVAR (TV_TREE_STRLEN , "tree strlen optimization") diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h index 38902b1b01b..9843d189d27 100644 --- a/gcc/tree-pass.h +++ b/gcc/tree-pass.h @@ -451,7 +451,7 @@ extern gimple_opt_pass *make_pass_early_warn_uninitialized (gcc::context *ctxt); extern gimple_opt_pass *make_pass_late_warn_uninitialized (gcc::context *ctxt); extern gimple_opt_pass *make_pass_cse_reciprocals (gcc::context *ctxt); extern gimple_opt_pass *make_pass_cse_sincos (gcc::context *ctxt); -extern gimple_opt_pass *make_pass_expand_powcabs (gcc::context *ctxt); +extern gimple_opt_pass *make_pass_expand_pow (gcc::context *ctxt); extern gimple_opt_pass *make_pass_optimize_bswap (gcc::context *ctxt); extern gimple_opt_pass *make_pass_store_merging (gcc::context *ctxt); extern gimple_opt_pass *make_pass_optimize_widening_mul (gcc::context *ctxt); diff --git a/gcc/tree-ssa-math-opts.cc b/gcc/tree-ssa-math-opts.cc index 71f896a9790..a35caf5f058 100644 --- a/gcc/tree-ssa-math-opts.cc +++ b/gcc/tree-ssa-math-opts.cc @@ -2272,17 +2272,16 @@ make_pass_cse_sincos (gcc::context *ctxt) return new pass_cse_sincos (ctxt); } -/* Expand powi(x,n) into an optimal number of multiplies, when n is a constant. - Note the name is powcabs but cabs expansion was moved to the lower complex - pass. */ +/* Expand powi(x,n) into an optimal number of multiplies, when n is a + constant. */ namespace { -const pass_data pass_data_expand_powcabs = +const pass_data pass_data_expand_pow = { GIMPLE_PASS, /* type */ - "powcabs", /* name */ + "pow", /* name */ OPTGROUP_NONE, /* optinfo_flags */ - TV_TREE_POWCABS, /* tv_id */ + TV_TREE_POW, /* tv_id */ PROP_ssa, /* properties_required */ PROP_gimple_opt_math, /* properties_provided */ 0, /* properties_destroyed */ @@ -2290,11 +2289,11 @@ const pass_data pass_data_expand_powcabs = TODO_update_ssa, /* todo_flags_finish */ }; -class pass_expand_powcabs : public gimple_opt_pass +class pass_expand_pow : public gimple_opt_pass { public: - pass_expand_powcabs (gcc::context *ctxt) - : gimple_opt_pass (pass_data_expand_powcabs, ctxt) + pass_expand_pow (gcc::context *ctxt) + : gimple_opt_pass (pass_data_expand_pow, ctxt) {} /* opt_pass methods: */ @@ -2305,10 +2304,10 @@ public: unsigned int execute (function *) final override; -}; // class pass_expand_powcabs +}; // class pass_expand_pow unsigned int -pass_expand_powcabs::execute (function *fun) +pass_expand_pow::execute (function *fun) { basic_block bb; bool cfg_changed = false; @@ -2421,9 +2420,9 @@ pass_expand_powcabs::execute (function *fun) } // anon namespace gimple_opt_pass * -make_pass_expand_powcabs (gcc::context *ctxt) +make_pass_expand_pow (gcc::context *ctxt) { - return new pass_expand_powcabs (ctxt); + return new pass_expand_pow (ctxt); } /* Return true if stmt is a type conversion operation that can be stripped