Message ID | 20240701214657.3163066-1-quic_apinski@quicinc.com |
---|---|
Headers |
Return-Path: <gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E32C73810287 for <patchwork@sourceware.org>; Mon, 1 Jul 2024 21:47:48 +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 0AABF385C6CA for <gcc-patches@gcc.gnu.org>; Mon, 1 Jul 2024 21:47:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0AABF385C6CA 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 0AABF385C6CA 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=1719870431; cv=none; b=SR2q3xzhRWujO/GiZkwIVM0nOM9nRbMkkNNFP1IXvC4M/hu48RAGjiTHbYdXnBy1Tffw7/GKdSqKsjEssgMkza3gPN3G+Ig4QfoQUCO1OcuIVAbh7oMg2sCN4PhgxfRRl+UWMI4yJAAtQFuxfsQFdJ/qDv+ugTcoAKkjKRtimAU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719870431; c=relaxed/simple; bh=h8DWdCDI8p1wudO8CDkeH2lTxF8a/S/ULtiQpWahisk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Vz7k79Md1V8CfB373MQxlY50HEZwov/hQac9kh25Z86dagQo436nZs5TM4MjgA/INB2MUK+jd9TSYwlAscHyf0qpe9WHR4QcUFo0/yd/NtD3THR5jasMC/5J4Zxysl29RzbCRIo0jWOUunDB4a/Ebqx+b8JMkUAz+b03V1+Z/4U= 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 461J8AtH023893 for <gcc-patches@gcc.gnu.org>; Mon, 1 Jul 2024 21:47:09 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=hXBkiydDlijpE7071NQoJ6 +TNe7Dx7aBt+xQNA9jfew=; b=TjdDablaO3w+zLpHhxLAehfm/J+hVh7O3Pg/Ah XYbyg0whqWgp4hX0e5ybrAcS/vgCm+11UWlAuY/cOxnHGJyeH+JEicR041WN2+xJ ITjQNXBzks8MnNrMGTiJ/bphzBGXlO5AzfNQ8V6z51yM+5EQKXcVquWsv5FEzp3r yEYHWXIIvybRNZFQt4OtMh4hzC+YFuYbGwtBXSilxTueqQ8VJRaXwuWcLrpG8rGW 4KslfA+BFPwGj6JeWRzluHM+XGnu5D9OQqGIKod0Mn1gGOjtt52I4vX5TXLoD4gT 0GMPpGgX1h14WpD/w2AY1TWNccBwbeW1GNCRb3VMbJe4lzoQ== Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4027mnnrr0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for <gcc-patches@gcc.gnu.org>; Mon, 01 Jul 2024 21:47:09 +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 461Ll8nR012628 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for <gcc-patches@gcc.gnu.org>; Mon, 1 Jul 2024 21:47:08 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:08 -0700 From: Andrew Pinski <quic_apinski@quicinc.com> To: <gcc-patches@gcc.gnu.org> CC: Andrew Pinski <quic_apinski@quicinc.com> Subject: [PATCH 0/4] Some improvements to complex lowering (cabs related) Date: Mon, 1 Jul 2024 14:46:53 -0700 Message-ID: <20240701214657.3163066-1-quic_apinski@quicinc.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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: McciBQNkSO75lYItwG3sXktgonNr4--B X-Proofpoint-GUID: McciBQNkSO75lYItwG3sXktgonNr4--B 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=1 spamscore=0 malwarescore=0 adultscore=0 priorityscore=1501 lowpriorityscore=1 phishscore=0 mlxscore=0 suspectscore=0 clxscore=1015 mlxlogscore=260 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2407010162 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org |
Series |
Some improvements to complex lowering (cabs related)
|
|
Message
Andrew Pinski
July 1, 2024, 9:46 p.m. UTC
This patch series includes some improvements to complex lowering, all related to cabs. History of the cabs folding cabs folding was originally add in builtins.c ( and 4.3 [r0-78875-gd1ad84c20452e6]) The expansion to `sqrt(r*r+i*i)` added to cse sincos pass in GCC 4.7 (r0-109444-gd7e2a1c13835e7) to fix an lto issue where `r*r` would be convert into `pow(r, 2.0)` after the cse_sincos pass (which at the time also did pow expansion). The other cabs folding for the constant/same value optimization was moved to match in GCC 6 (r6-4111-gabcc43f5323869). This series moves all possible cabs expansion/simplifications to complex lowering which already has a decent lattice and folding which allows `cabs(x+xI)` and `cabs(x+0.0I)` and `cabs(0.0+xI)` be detected. Andrew Pinski (4): Small optimization for complex addition, real/imag parts the same Move cabs expansion from powcabs to complex lowering [PR115710] Add some optimizations to gimple_expand_builtin_cabs Rename expand_powcabs pass to expand_pow gcc/passes.def | 2 +- gcc/testsuite/gcc.dg/pow-sqrt-synth-1.c | 4 +- gcc/testsuite/gcc.dg/tree-ssa/cabs-1.c | 14 +++ gcc/testsuite/gcc.dg/tree-ssa/cabs-2.c | 13 +++ gcc/testsuite/gcc.dg/tree-ssa/cabs-3.c | 24 +++++ gcc/testsuite/gcc.dg/tree-ssa/cabs-4.c | 16 +++ gcc/testsuite/gcc.dg/tree-ssa/cabs-5.c | 22 ++++ gcc/testsuite/gcc.dg/tree-ssa/cabs-6.c | 16 +++ gcc/testsuite/gcc.dg/tree-ssa/complex-8.c | 12 +++ gcc/testsuite/gfortran.dg/vect/pr115710.f90 | 18 ++++ gcc/timevar.def | 2 +- gcc/tree-complex.cc | 109 +++++++++++++++++++- gcc/tree-pass.h | 2 +- gcc/tree-ssa-math-opts.cc | 91 +++------------- 14 files changed, 258 insertions(+), 87 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/cabs-1.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/cabs-2.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/cabs-3.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/cabs-4.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/cabs-5.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/cabs-6.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/complex-8.c create mode 100644 gcc/testsuite/gfortran.dg/vect/pr115710.f90