From patchwork Tue Oct 22 15:29:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 2000533 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=hqJV3StC; 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 4XXx3K64Fvz1xtp for ; Wed, 23 Oct 2024 02:31:09 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1555D3858C42 for ; Tue, 22 Oct 2024 15:31:08 +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 A23B33858D20 for ; Tue, 22 Oct 2024 15:29:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A23B33858D20 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 A23B33858D20 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=1729610989; cv=none; b=iLS9Jcg+TWYnBX9bBrOXUEwdwYhtoqqSOrY4khsRqSrtyjzA9s9R8oUHPgIQSh5S6kU8dqKPJVNl+faT5MDW7epi7qXDrog9TI7LAUZKfspPOvS1lAPOlstD09BgK7MD9xkic0KHJ3RgDBI0dpqAWoBasHR1FIu2LAV1FNCPO5M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1729610989; c=relaxed/simple; bh=UYUy2Lx6nnAJS2iYfnAqbBNxJkpBYln0vPq5+6vW1ZU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Pn/vcls0j0PgMqpjDKvpCNM4j3q1ubfe/Q1Q/KuMtn77Kz/ab5ElchTsL6qrxZWqFemhMmNLxjxGcULY55040BQ1A3iWAAjly8OIlXUQ4sUzYCzHJE1+NuRAj4p5tMIRTsZrgocQdKqLaEkwF+MhmLXD08XY9aQ3cEaepARqJrM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49M8tIpu016306 for ; Tue, 22 Oct 2024 15:29:35 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=WGn1hsphbUOb23+9ODwsHP STwstygxJ4ZAynEaXetbs=; b=hqJV3StCzLU/r9gcpF6GzibOrW3mdBQUnQspUe 9DSP+QpNu4vv1w8TmlMjYHRYijl5HZm+kTHdHzZM2Gj1OMYZUaXuOzH0RF5acCNC v1sQ4ZkF9/I1BXlTGEFH+oEeMwuX2Z92bG42AM0G+WfcP/IKiA1p6iicQz6KB2Nr YwC1dnzCn7BvbjCAYDr7/z+qLOTBZ9Tv0lnEfl/2WGS10o54UrZY3yiMdnpMeL9g ++OERABeMQhfnNWwHgRQigqsrutQNDAryPFMkg4Th237fA0/atQKzTHO5YxS5N7W BqbZVJUbhmhRLPl4KONHNvPcwlY1iboTKCJP8nm6JODAnDyQ== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 42dmdqcpht-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 22 Oct 2024 15:29:34 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 49MFTXtb001619 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 22 Oct 2024 15:29:33 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; Tue, 22 Oct 2024 08:29:32 -0700 From: Andrew Pinski To: CC: Andrew Pinski Subject: [PATCH 1/5] vec: Add quick_emplace_push/safe_emplace_push Date: Tue, 22 Oct 2024 08:29:19 -0700 Message-ID: <20241022152923.1489747-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: nalasex01c.na.qualcomm.com (10.47.97.35) 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: QRpbHyzXGsKl15bey18WuylDsKhDkInZ X-Proofpoint-GUID: QRpbHyzXGsKl15bey18WuylDsKhDkInZ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 priorityscore=1501 spamscore=0 mlxscore=0 phishscore=0 suspectscore=0 lowpriorityscore=0 clxscore=1015 malwarescore=0 impostorscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410220099 X-Spam-Status: No, score=-14.0 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 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 This adds quick_emplace_push and safe_emplace_push to vec. These are like std::vector's emplace_back so you don't need an extra copy of the struct around. Since we require C++11 and also support partial non-PODs for vec, these functions can be added. I will be using them to cleanup some code and even improving how some places use vec. Bootstrapped and tested on x86_64-linux-gnu. gcc/ChangeLog: * vec.h (vec::quick_emplace_push): New function. (vec::quick_emplace_push): New function. (vec::safe_emplace_push): New function. * vec.cc (test_init): Add test for safe_emplace_push. (test_quick_emplace_push): New function. (test_safe_emplace_push): New function. (vec_cc_tests): Call test_quick_emplace_push and test_safe_emplace_push. Signed-off-by: Andrew Pinski --- gcc/vec.cc | 41 +++++++++++++++++++++++++++++++++++++++++ gcc/vec.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) diff --git a/gcc/vec.cc b/gcc/vec.cc index ba963b96c6a..cd7cd3c156b 100644 --- a/gcc/vec.cc +++ b/gcc/vec.cc @@ -304,6 +304,10 @@ test_init () ASSERT_EQ (2, v1.length ()); ASSERT_EQ (2, v2.length ()); + v2.safe_emplace_push (1); + + ASSERT_EQ (3, v1.length ()); + ASSERT_EQ (3, v2.length ()); v1.release (); } } @@ -327,6 +331,25 @@ test_quick_push () ASSERT_EQ (7, v[2]); } +/* Verify that vec::quick_emplace_push works correctly. */ + +static void +test_quick_emplace_push () +{ + auto_vec > v; + ASSERT_EQ (0, v.length ()); + v.reserve (3); + ASSERT_EQ (0, v.length ()); + ASSERT_TRUE (v.space (3)); + v.quick_emplace_push (5, 5); + v.quick_emplace_push (6, 6); + v.quick_emplace_push (7, 7); + ASSERT_EQ (3, v.length ()); + ASSERT_EQ (std::make_pair(5,5), v[0]); + ASSERT_EQ (std::make_pair(6,6), v[1]); + ASSERT_EQ (std::make_pair(7,7), v[2]); +} + /* Verify that vec::safe_push works correctly. */ static void @@ -343,6 +366,22 @@ test_safe_push () ASSERT_EQ (7, v[2]); } +/* Verify that vec::safe_emplace_push works correctly. */ + +static void +test_safe_emplace_push () +{ + auto_vec > v; + ASSERT_EQ (0, v.length ()); + v.safe_emplace_push (5, 5); + v.safe_emplace_push (6, 6); + v.safe_emplace_push (7, 7); + ASSERT_EQ (3, v.length ()); + ASSERT_EQ (std::make_pair(5,5), v[0]); + ASSERT_EQ (std::make_pair(6,6), v[1]); + ASSERT_EQ (std::make_pair(7,7), v[2]); +} + /* Verify that vec::truncate works correctly. */ static void @@ -591,7 +630,9 @@ vec_cc_tests () { test_init (); test_quick_push (); + test_quick_emplace_push (); test_safe_push (); + test_safe_emplace_push (); test_truncate (); test_safe_grow_cleared (); test_pop (); diff --git a/gcc/vec.h b/gcc/vec.h index b13c4716428..8277d156f05 100644 --- a/gcc/vec.h +++ b/gcc/vec.h @@ -619,6 +619,8 @@ public: void splice (const vec &); void splice (const vec *src); T *quick_push (const T &); + template + T *quick_emplace_push (Args&&... args); using pop_ret_type = typename std::conditional ::value, T &, void>::type; @@ -1044,6 +1046,21 @@ vec::quick_push (const T &obj) return slot; } +/* Push T(ARGS) (a new element) onto the end of the vector. There must be + sufficient space in the vector. Return a pointer to the slot + where T(ARGS) was inserted. */ + +template +template +inline T * +vec::quick_emplace_push (Args&&... args) +{ + gcc_checking_assert (space (1)); + T *slot = &address ()[m_vecpfx.m_num++]; + ::new (static_cast(slot)) T (std::forward(args)...); + return slot; +} + /* Pop and return a reference to the last element off the end of the vector. If T has non-trivial destructor, this method just pops @@ -1612,7 +1629,11 @@ public: void splice (const vec &); void safe_splice (const vec & CXX_MEM_STAT_INFO); T *quick_push (const T &); + template + T *quick_emplace_push (Args&&... args); T *safe_push (const T &CXX_MEM_STAT_INFO); + template + T *safe_emplace_push (Args&&... args CXX_MEM_STAT_INFO); using pop_ret_type = typename std::conditional ::value, T &, void>::type; @@ -2070,6 +2091,18 @@ vec::quick_push (const T &obj) return m_vec->quick_push (obj); } +/* Push OBJ (a new element) onto the end of the vector. There must be + sufficient space in the vector. Return a pointer to the slot + where OBJ was inserted. */ + +template +template +inline T * +vec::quick_emplace_push (Args&& ... args) +{ + return m_vec->quick_emplace_push (std::forward(args)...); +} + /* Push a new element OBJ onto the end of this vector. Reallocates the embedded vector, if needed. Return a pointer to the slot where @@ -2083,6 +2116,19 @@ vec::safe_push (const T &obj MEM_STAT_DECL) return quick_push (obj); } +/* Push a new element T(ARGS) onto the end of this vector. Reallocates + the embedded vector, if needed. Return a pointer to the slot where + OBJ was inserted. */ + +template +template +inline T * +vec::safe_emplace_push (Args&&... args MEM_STAT_DECL) +{ + reserve (1, false PASS_MEM_STAT); + return quick_emplace_push (std::forward(args)...); +} + /* Pop and return a reference to the last element off the end of the vector. If T has non-trivial destructor, this method just pops From patchwork Tue Oct 22 15:29:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 2000531 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=S+lOaLlA; 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 4XXx2L3jrzz1xtp for ; Wed, 23 Oct 2024 02:30:18 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A978A3858435 for ; Tue, 22 Oct 2024 15:30:16 +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 A299A3858D21 for ; Tue, 22 Oct 2024 15:29:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A299A3858D21 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 A299A3858D21 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=1729610983; cv=none; b=K+dAHpu7cA2O/eVeBP4bsBvuN4DIzc61BWUaZhVVZRZIS8vmhCshvr/N4gaxhkLM4XqJ/EpxSvIt0e7Sf4xbYC8DeNRp2kYf8FcsEqEiFithCyaoV1O5uNCNOf2mGCRMd7lnyCT/K+IqTEP87dxk+14pKWXmZog4rfUlRURMDkc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1729610983; c=relaxed/simple; bh=sKbsrDksV0IfBxE1TIB6z13BsZTSdDqypumPSEZow7I=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=skpJp6GlGiksK3sJ/ZDQ4sCGYJRYvh4joAHYY9zgQMNTiRvQ3XL0bUwac/SuUZq/oh8iF7FsNr+FbBya57unChnzWLrkV3SfRITSs5mi+11sZUmHb1LWOGPSLIC546Q2C+DhlFV6FOMl6pb36guPAqSBzRAoq5mlqCTKzt/YF+U= 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 49MF3aMA009622 for ; Tue, 22 Oct 2024 15:29:35 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= VbnDvSUI5q4K7c9NhnoFasDoorIVjevf2/7rPGqoSmo=; b=S+lOaLlAQUt4t4Nq G/cKP1KBUxpx3SMZN414mZeWi0PPGmEB5cO2oX6He4xg2LBH410cnulWE0QxJNuU SmGio22tdYwVO76gkVCg4xP845LRy9Q0gB3eOfTkjfzkgpC2f4PxleQ7uM0pTF2T rHmm6i7asnqQB4eWkAP8OqD/8ZMeMhnR40wHWCsL/aiiIH26eckqyWC7Yi7LKTi0 huwRLbCQUPl0DzpNsWcW7Ct598pz2adookBPXG5WnEGlUktktWxBPvVtmo583CX2 laOUORb9MqSEM7/36NKrBhE5S1wDeKw93tIgteHsotMlSWn/C1i64WqzoqPDwVSL m5mB6Q== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 42dkbt54sa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 22 Oct 2024 15:29:34 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA04.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 49MFTXU3003659 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 22 Oct 2024 15:29:33 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; Tue, 22 Oct 2024 08:29:33 -0700 From: Andrew Pinski To: CC: Andrew Pinski Subject: [PATCH 2/5] phiopt: use safe_emplace_push Date: Tue, 22 Oct 2024 08:29:20 -0700 Message-ID: <20241022152923.1489747-2-quic_apinski@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241022152923.1489747-1-quic_apinski@quicinc.com> References: <20241022152923.1489747-1-quic_apinski@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01c.na.qualcomm.com (10.47.97.35) 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: jGci3I94r8ckECa4WxHfcjC9t9bG-ein X-Proofpoint-GUID: jGci3I94r8ckECa4WxHfcjC9t9bG-ein X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 mlxscore=0 bulkscore=0 malwarescore=0 lowpriorityscore=0 mlxlogscore=799 clxscore=1015 suspectscore=0 phishscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410220099 X-Spam-Status: No, score=-14.0 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 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 This is small cleanup now vec has safe_emplace_push. We can just call safe_emplace_push instead of also causing make_pair. Bootstrapped and tested on x86_64-linux-gnu. gcc/ChangeLog: * tree-ssa-phiopt.cc (auto_flow_sensitive::auto_flow_sensitive): Use safe_emplace_push instead of `safe_push( make_pair (`. (cond_if_else_store_replacement): Likewise. Signed-off-by: Andrew Pinski --- gcc/tree-ssa-phiopt.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc index 6a89f57a41a..5eca7f80f01 100644 --- a/gcc/tree-ssa-phiopt.cc +++ b/gcc/tree-ssa-phiopt.cc @@ -899,7 +899,7 @@ auto_flow_sensitive::auto_flow_sensitive (gimple *s) { flow_sensitive_info_storage storage; storage.save_and_clear (def); - stack.safe_push (std::make_pair (def, storage)); + stack.safe_emplace_push (def, storage); } } @@ -3787,7 +3787,7 @@ cond_if_else_store_replacement (basic_block then_bb, basic_block else_bb, if (!found) continue; - stores_pairs.safe_push (std::make_pair (then_store, else_store)); + stores_pairs.safe_emplace_push (then_store, else_store); } /* No pairs of stores found. */ From patchwork Tue Oct 22 15:29:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 2000529 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=VoWDPmME; 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 4XXx2F01vPz1xtp for ; Wed, 23 Oct 2024 02:30:10 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EFC6D3858429 for ; Tue, 22 Oct 2024 15:30:08 +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 23E7B3858D33 for ; Tue, 22 Oct 2024 15:29:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 23E7B3858D33 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 23E7B3858D33 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=1729610980; cv=none; b=NiYJawgn9rUAgSRCyeIrMVhFx6hvXGjaB5CEhLzym/foantaNyLdMxMEPxaWF+pfCVmOUiw3QQmgSmJSHQexaQmES9bcEY9+nFkGrr4//kGGY+kbhPlyjnwrIrykbslx25seDgnVJw8mmsR1JqDVdI59f5bcq9g+tuTGPg+5Rjw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1729610980; c=relaxed/simple; bh=78qEvFiYm9WPch0D0CQyQeI8iuLUFCGlarYVk7Jc1mI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=jUIqQrd+vLHaoP8ConhNPnr01c/miilzaq/NYTuF/hYq7HLFq/81nB+aGH7dC10YBu5ktejefLsfuFlBVQFcvB6jfrW+wfaZq3arSVPfvhTL5bIYSrs0bUDeiuKQZteWLh0HUuzjiVdciHdz5TRkKgHB1VQWfETLdKPb/bfGapQ= 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 49M9sTJd016524 for ; Tue, 22 Oct 2024 15:29:35 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= 77NZmyrLEjg3QDHcUi2UpBCLnM1sr/2x7jjXqL3MGhI=; b=VoWDPmME0ZggeF64 ciVgng2KMDPbB/Sh3fsX7MkEEeJy38dP6MxEdU69q9v54vIUqU5DavWrZ8flnkUy X4TBonhofgxKRPNISEiRnPFFPCxl5lGINMW6GE5thagnmgg2V7Ufl+QU4El5hauG ZfE5KibBlOjvpil0S1IeRnNYOBYRzbD+20V+hUxrdp3OWyl3O65fF6GCt7v4dL28 lKZs2cMsoS758mFSbMONdr9lGIjYBDvLSTHKyaXVeezQpHGj+0xOeBzF243uhLr0 +nhG6jNtuGbbPSq+JkXb9zYpfyFz5WFFPYBXYkMel6fFN6dHbalhiGW7s5Ga84ya QNkWKA== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 42c6rbgt38-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 22 Oct 2024 15:29:34 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 49MFTX2j001627 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 22 Oct 2024 15:29:33 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; Tue, 22 Oct 2024 08:29:33 -0700 From: Andrew Pinski To: CC: Andrew Pinski Subject: [PATCH 3/5] gimple-fold: use safe_emplace_push Date: Tue, 22 Oct 2024 08:29:21 -0700 Message-ID: <20241022152923.1489747-3-quic_apinski@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241022152923.1489747-1-quic_apinski@quicinc.com> References: <20241022152923.1489747-1-quic_apinski@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01c.na.qualcomm.com (10.47.97.35) 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: wvHbn_9HhC_PYSaV3xs-j6WQh5yVr_8y X-Proofpoint-GUID: wvHbn_9HhC_PYSaV3xs-j6WQh5yVr_8y X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 adultscore=0 malwarescore=0 mlxscore=0 suspectscore=0 spamscore=0 impostorscore=0 phishscore=0 mlxlogscore=774 lowpriorityscore=0 clxscore=1015 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410220099 X-Spam-Status: No, score=-14.0 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 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 This is small cleanup now vec has safe_emplace_push. We can just call safe_emplace_push instead of also causing make_pair. Bootstrapped and tested on x86_64-linux-gnu. gcc/ChangeLog: * gimple-fold.cc (follow_outer_ssa_edges): Use safe_emplace_push instead of `safe_push( std::make_pair (`. Signed-off-by: Andrew Pinski --- gcc/gimple-fold.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/gimple-fold.cc b/gcc/gimple-fold.cc index d4ec7475990..7047e450c5f 100644 --- a/gcc/gimple-fold.cc +++ b/gcc/gimple-fold.cc @@ -7287,7 +7287,7 @@ follow_outer_ssa_edges (tree val) storage.save_and_clear (val); /* If the definition does not dominate fosa_bb temporarily reset flow-sensitive info. */ - fosa_unwind->safe_push (std::make_pair (val, storage)); + fosa_unwind->safe_emplace_push (val, storage); return val; } return val; From patchwork Tue Oct 22 15:29:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 2000530 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=YP90GSuA; 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 4XXx2H5k45z1xtp for ; Wed, 23 Oct 2024 02:30:15 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DD4F4385800F for ; Tue, 22 Oct 2024 15:30:13 +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 2C33A3858D39 for ; Tue, 22 Oct 2024 15:29:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2C33A3858D39 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 2C33A3858D39 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=1729610990; cv=none; b=f4Eoqwzwqm6c3p0/6JDkX18n9MVznpZFaJa1Nru8LSSE4Pr2Wn+H9K4UCxhEtFgu3A+5zIeQ8ayAtUNOMSGyPhEIqqBrAKyo8g3AA/yDKoaPzd+HOLBnHQ5aNoofvIevmq5ocHo4OLA34uwSKgyDwBamtlEqBGkCNOH+gdfnju8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1729610990; c=relaxed/simple; bh=E+642RJtsaCTQQ1MxEKuvRlw4C3ceZZ1L4dXrucmEuE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=GZvLHuUx1aCFI0Wpbulb2iS/5/gZq2gN6LYsiqiBY22N6vZ3SG/ORpNwczschA5fLJWc3VtfMMdQ0T4+VOh7wFlVCFj2xdcqrl6qrkXnboAMJT7Mtt7Amiz3mZEhAid9YqeQxRwdeOkfcSPscpy5Hz1d1vnZuA6nZjo5om7Ci0c= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49MF88aP018992 for ; Tue, 22 Oct 2024 15:29:35 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= uz2pipdsq8Z5UfrsqeqfHvtFtxURALPra8k4j82rg84=; b=YP90GSuAY7vS1wgb TT1J7BIvNqYab/K7RoB2QCwOcIM0eX6l3hHizqWcRC/Oo2a1cgWS9+4xnhKEpt9f mr837cjForeMc21bwlqJ9uE6xbRr6/2qUzAxn9L+NZQQbbLWzk9/Rs8cqSxCanK5 n8b+omlWpOSQCXAuxRLuqTGjdzT/muU3vHoVPwsQyeynJG7E6uiY5ks6aSl1lCBE wxdXvDpcu9/gumszeQU1RlbH9YU+ReKKmQiscPu8Xf47wBVktiXtciY0CiwBPrB1 g0OLZs4gYSdNt/8pNikr7+CPc0DF74JtjVCTrliV5LocKaZHFh2Yb+P/DdiraoK5 excNtA== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 42e77phhsg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 22 Oct 2024 15:29:35 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA04.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 49MFTYWg003663 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 22 Oct 2024 15:29:34 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; Tue, 22 Oct 2024 08:29:33 -0700 From: Andrew Pinski To: CC: Andrew Pinski Subject: [PATCH 4/5] ssa-forwprop: use safe_emplace_push Date: Tue, 22 Oct 2024 08:29:22 -0700 Message-ID: <20241022152923.1489747-4-quic_apinski@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241022152923.1489747-1-quic_apinski@quicinc.com> References: <20241022152923.1489747-1-quic_apinski@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01c.na.qualcomm.com (10.47.97.35) 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: xh_hjQI8Oprfevk0dAK0M3jvSr3Y_jgV X-Proofpoint-ORIG-GUID: xh_hjQI8Oprfevk0dAK0M3jvSr3Y_jgV X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 lowpriorityscore=0 suspectscore=0 impostorscore=0 adultscore=0 bulkscore=0 phishscore=0 mlxlogscore=978 spamscore=0 malwarescore=0 priorityscore=1501 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410220099 X-Spam-Status: No, score=-14.0 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 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 This is small cleanup now vec has safe_emplace_push. We can just call safe_emplace_push instead of also causing make_pair. Bootstrapped and tested on x86_64-linux-gnu. gcc/ChangeLog: * tree-ssa-forwprop.cc (simplify_gimple_switch_label_vec): Use safe_emplace_push instead of `safe_push( std::make_pair (`. (simplify_vector_constructor): Likewise. Signed-off-by: Andrew Pinski --- gcc/tree-ssa-forwprop.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gcc/tree-ssa-forwprop.cc b/gcc/tree-ssa-forwprop.cc index 766eaf0e4e7..ab02fb23e26 100644 --- a/gcc/tree-ssa-forwprop.cc +++ b/gcc/tree-ssa-forwprop.cc @@ -1027,8 +1027,7 @@ simplify_gimple_switch_label_vec (gswitch *stmt, tree index_type, for (ei = ei_start (gimple_bb (stmt)->succs); (e = ei_safe_edge (ei)); ) { if (! bitmap_bit_p (target_blocks, e->dest->index)) - edges_to_remove.safe_push (std::make_pair (e->src->index, - e->dest->index)); + edges_to_remove.safe_emplace_push (e->src->index, e->dest->index); else ei_next (&ei); } @@ -2926,7 +2925,7 @@ simplify_vector_constructor (gimple_stmt_iterator *gsi) maybe_ident = false; if (elem != i) maybe_blend[j] = false; - elts.safe_push (std::make_pair (j, elem)); + elts.safe_emplace_push (j, elem); continue; } /* Else fallthru. */ @@ -2955,7 +2954,7 @@ simplify_vector_constructor (gimple_stmt_iterator *gsi) else if (!operand_equal_p (one_nonconstant, elt->value, 0)) return false; } - elts.safe_push (std::make_pair (1, i)); + elts.safe_emplace_push (1, i); maybe_ident = false; } if (i < nelts) From patchwork Tue Oct 22 15:29:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 2000528 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=JWYKej8p; 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 4XXx2C6Gwvz1xw0 for ; Wed, 23 Oct 2024 02:30:10 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2B5423858D20 for ; Tue, 22 Oct 2024 15:30:07 +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 399F43858D28 for ; Tue, 22 Oct 2024 15:29:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 399F43858D28 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 399F43858D28 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=1729610979; cv=none; b=B46AYDHtNNhs2KTZdztCMty952am1ewBaLmPsoNVqPl1T6WFYvl8jFJ5UwLGTvZeFRSkfRM4BpNvhWZkgARDrVN/DU/H15Xt7LW3YHGLEW3Vi2RvAald6jnYZ2jgFAyEEWwZCCzMv5iCpVYt3TyHKDi/OB1HcUShh9o9Yhi3GS0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1729610979; c=relaxed/simple; bh=fhU92Wzy9NPeeoPEqOvsaC0TeZiobhOgkdbcquXBGB8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ubeUOOCdiNk5o28n7QbHViGWvsfgQ4WeZOpZ03SBcli5/pULMnBLuAF6JfF5UG6Fjdj6xAlde36+Kpx1uW4wttOUzf6IHnC9GPFIf+8+JrqWmeu/tK8JTueHZR51HV8IkYb+edna8P+uZHpwImu4TsiZrGGMcBGi25AZ3H5G+Cc= 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 49M9W7XD025211 for ; Tue, 22 Oct 2024 15:29:35 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= KmpMfWebQ0gDFOOMdninIh91XOO35uKKfK/rflNXe9Q=; b=JWYKej8pzOZiLzUl Vt5jaz5xifBeWG7Dh9J86u8/piE/pjdvUqAOFjN0z2GFKIqN06ob4sIhvzCxjlq2 Jr0qeAmD6s6Kd52H3bNckERYGdvsAZ8srcVBUUOAEiTLqiIk+1CQnND6VIGh6I/j a2s8GXKyqIDeQfze9wiJeKtivO+BZ/NFvjFnva88SlfPHxJjm+fNlxSyGBVGmrH3 HkYznIiBnSUnVb6kpGGw2xKbN4mFeo8KycZJ4L1IqRqtnHjCozrom3iu/S9U+lvg dg/oypjIEh5s95W2AVn89WaKHRqRdQ91PYTs8Sx/6ySWeAfI9yitpkvgFuqt6pK3 EqcztQ== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 42c6vv0ty7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 22 Oct 2024 15:29:35 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA01.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 49MFTYDf022636 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 22 Oct 2024 15:29:34 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; Tue, 22 Oct 2024 08:29:34 -0700 From: Andrew Pinski To: CC: Andrew Pinski Subject: [PATCH 5/5] ssa-dce: use safe_emplace_push Date: Tue, 22 Oct 2024 08:29:23 -0700 Message-ID: <20241022152923.1489747-5-quic_apinski@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241022152923.1489747-1-quic_apinski@quicinc.com> References: <20241022152923.1489747-1-quic_apinski@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01c.na.qualcomm.com (10.47.97.35) 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: cXjAZEoZll4QBrQA8EqVBODTUYdFGhPo X-Proofpoint-GUID: cXjAZEoZll4QBrQA8EqVBODTUYdFGhPo X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 phishscore=0 mlxlogscore=633 bulkscore=0 spamscore=0 mlxscore=0 clxscore=1011 suspectscore=0 priorityscore=1501 adultscore=0 lowpriorityscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410220099 X-Spam-Status: No, score=-14.0 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 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 This is small cleanup now vec has safe_emplace_push. We can just call safe_emplace_push instead of also causing make_pair. Bootstrapped and tested on x86_64-linux-gnu. gcc/ChangeLog: * tree-ssa-dce.cc (make_forwarders_with_degenerate_phis): Use safe_emplace_push instead of `safe_push( std::make_pair (`. Signed-off-by: Andrew Pinski --- gcc/tree-ssa-dce.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/tree-ssa-dce.cc b/gcc/tree-ssa-dce.cc index 015c17984e1..2aca62a1ae1 100644 --- a/gcc/tree-ssa-dce.cc +++ b/gcc/tree-ssa-dce.cc @@ -1834,7 +1834,7 @@ make_forwarders_with_degenerate_phis (function *fn) tree arg = gimple_phi_arg_def (phi, i); if (!CONSTANT_CLASS_P (arg) && TREE_CODE (arg) != SSA_NAME) need_resort = true; - args.safe_push (std::make_pair (e, iterative_hash_expr (arg, 0))); + args.safe_emplace_push (e, iterative_hash_expr (arg, 0)); } if (args.length () < 2) continue;