From patchwork Fri Apr 26 23:03:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 89069 Return-Path: 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 CBA3F384AB7B for ; Fri, 26 Apr 2024 23:04:49 +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 6B6BF3858C50 for ; Fri, 26 Apr 2024 23:04:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6B6BF3858C50 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 6B6BF3858C50 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=1714172657; cv=none; b=OWPk6Y7R4U8f+QpXSwps5fmFIarWohzuJGukeAnpe2mT3nHajxnSovCjAObUm5LkZEByZdHNt9ewEvXglSSeCKAICEI8qJ0lki17qfkZGYF4VqFmp3JC7g1JSNaLC16Gr+KgDUxY+P+DZPIrJucVxdR9BL9Yg8fvaOoJvesJ2e8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714172657; c=relaxed/simple; bh=RPc40NfGZe3JcSG0QQT5PcGIo1vdzznquyUiEonEQgQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=tllNsh0QT9QD/7TgnPK0NCiMnoLDoS+YKAcNl5O5mr7qJvjZPz7q9bzRuVDjbmEFDGnvUnhOxwJn4jBBIxejKckIWj7nm+99mampuDNX1gNaU/kC0NaaWmQ6/d/2K5eTAiNFrycNZq/KGYlmZsGFr1qb0eSUkO5SJuTqG0/kOjs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 43QLu7Nd004244 for ; Fri, 26 Apr 2024 23:04:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:content-type; s=qcppdkim1; bh=/Id/Q6n oTqRXPNvV3NmurxG0OAr0qOJNABcDoDFo0g4=; b=boc/gmIsSj4pac01g3nqKXl s//Kd0G31I35OJMi8H/0deqNICTS8bjY7ZJLbLNpcpWxBBxdVhfScVOHBOyYLfP6 aMxmXUtGDt4LnzG0J9rxCQPIK9gtKKvqC56wp4uhAg71cKSvRgt/akUCFB7rIvf0 IGgAcAqBJQiiMwUkB1F+Gse1HaCDDwY3DZVe5uMDWwJiqsA4epVNDIpJWlOozzwK 3632avPiDpFa0zEPH++kWAt5xi2Pqvb5uqbCCoE2R3uIHE74ATAvDwfs4OyMaAzg Han1YpE5CnTIBJ7xmDPbJ5KMcdBmwyvZwGZyz3AK8ughfnGqbfda8NakKZAca/w= = Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xrdmr11xx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 26 Apr 2024 23:04:08 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 43QN47kr016731 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 26 Apr 2024 23:04:07 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; Fri, 26 Apr 2024 16:04:06 -0700 From: Andrew Pinski To: CC: Andrew Pinski Subject: [PATCH 1/2] Add verification of gimple_assign_nontemporal_move_p [PR112976] Date: Fri, 26 Apr 2024 16:03:52 -0700 Message-ID: <20240426230353.3131438-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: nalasex01a.na.qualcomm.com (10.47.209.196) 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: tzfJc8yuISN7W6DqL4nrXAxkEcI7MJZq X-Proofpoint-GUID: tzfJc8yuISN7W6DqL4nrXAxkEcI7MJZq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-04-26_19,2024-04-26_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 impostorscore=0 mlxlogscore=999 mlxscore=0 bulkscore=0 phishscore=0 clxscore=1015 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404260161 X-Spam-Status: No, score=-13.3 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+patchwork=sourceware.org@gcc.gnu.org Currently the middle-end only knows how to support temporal stores (the undocumented storent optab) so let's verify that the only time we set nontemporal_move on an assign is if the the lhs is not a gimple reg. Bootstrapped and tested on x86_64-linux-gnu no regressions. gcc/ChangeLog: PR middle-end/112976 * tree-cfg.cc (verify_gimple_assign): Verify that nontmporal moves are stores. * gimple.h (struct gimple): Note that only nontemporal stores are supported. Signed-off-by: Andrew Pinski --- gcc/gimple.h | 3 ++- gcc/tree-cfg.cc | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/gcc/gimple.h b/gcc/gimple.h index 8a8ca109bbf..bd315ffc2dd 100644 --- a/gcc/gimple.h +++ b/gcc/gimple.h @@ -236,7 +236,8 @@ struct GTY((desc ("gimple_statement_structure (&%h)"), tag ("GSS_BASE"), for clearing this bit before using it. */ unsigned int visited : 1; - /* Nonzero if this tuple represents a non-temporal move. */ + /* Nonzero if this tuple represents a non-temporal move; currently + only stores are supported. */ unsigned int nontemporal_move : 1; /* Pass local flags. These flags are free for any pass to use as diff --git a/gcc/tree-cfg.cc b/gcc/tree-cfg.cc index b1ba33018fd..06a96f96be7 100644 --- a/gcc/tree-cfg.cc +++ b/gcc/tree-cfg.cc @@ -4837,6 +4837,17 @@ verify_gimple_assign_single (gassign *stmt) static bool verify_gimple_assign (gassign *stmt) { + if (gimple_assign_nontemporal_move_p (stmt)) + { + tree lhs = gimple_assign_lhs (stmt); + if (is_gimple_reg (lhs)) + { + error ("nontemporal store lhs cannot a gimple register"); + debug_generic_stmt (lhs); + return true; + } + } + switch (gimple_assign_rhs_class (stmt)) { case GIMPLE_SINGLE_RHS: From patchwork Fri Apr 26 23:03:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 89068 Return-Path: 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 9A324384AB78 for ; Fri, 26 Apr 2024 23:04:49 +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 66DCD3858C42 for ; Fri, 26 Apr 2024 23:04:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 66DCD3858C42 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 66DCD3858C42 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=1714172657; cv=none; b=ffJSkzKevLNGsknINWWLJLYs2ZVbk+kFM2LzI/xAb/H4nIiLDsO+uZKLGzi4va6NA57Y4X/++YjW+bbdlRloJgBR5HVHGBSsnfx+/YCvPhoGRL2lFCgd3mIu7swqMQTPijN9VuuzV6b/PzXMhevHb/9jazSTxrUyZF85UL/8JGc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714172657; c=relaxed/simple; bh=dZQjA1crgS+z475KwWzzgvbkhMdZu6fer9Ght8hBCIU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=qQiSgjap22xAwtpIcKBasoCWdhFFlqbDnyG39q14pSNsApAm3e4IhBi10fGQFMn3oBYZ1lKBU6tGHrEcuMqcq+HxvJ9xbUVPQpqNLERGxBQHw3WSoG1wFQ+yVFVc5cq1JKwXY27ibJirncr7xTGEIef5J7dD2Mi/HxTtYEI6gRo= 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 43QMG87G020875 for ; Fri, 26 Apr 2024 23:04:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=gr3nh5ga55Jy7ZmdVi+8Jbs/XJ7CemOeKUw2JVabpTI=; b=A8 3lT7riBMdVj+HFNvkm5iGiyMF64uLjw05Uczd5gPnYD9cuw5lzA56nsqKCxIIwmb JNHRxNJZ7CRFMnwd01BJc2hjpzEIVOQj4Q39CKCZdOMUJ5UrNRq4RZ/dSny3Hyuj 97pQNO00nEEeJqCk5Stbcd3XY2I3Sx8AvjqRHH4n7eHf/A2jYNbXw1014Ee2mhMy 1gwkDKUAqjabwo+6RxQl0wY+ekqg3c3xPLoIAm5TeESVnc1QmK2iIVs63rjR53pm 245RkEmGQiEqVmNEmb6aqt0HnyTCFjRSBeWHMHmC0qwUDZOGFS+ffBwHfXNNy2oP EwaZ/uW3FWMz0uq9IrYA== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xr3593204-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 26 Apr 2024 23:04:08 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 43QN47ks016731 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 26 Apr 2024 23:04:07 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; Fri, 26 Apr 2024 16:04:07 -0700 From: Andrew Pinski To: CC: Andrew Pinski Subject: [PATCH 2/2] Remove support for nontemporal stores with ssa_names on lhs [PR112976] Date: Fri, 26 Apr 2024 16:03:53 -0700 Message-ID: <20240426230353.3131438-2-quic_apinski@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240426230353.3131438-1-quic_apinski@quicinc.com> References: <20240426230353.3131438-1-quic_apinski@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01a.na.qualcomm.com (10.47.209.196) 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: GaGA5rW2MtjEX9268-OVQ_yWYwgj0fsm X-Proofpoint-ORIG-GUID: GaGA5rW2MtjEX9268-OVQ_yWYwgj0fsm X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-04-26_19,2024-04-26_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 spamscore=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 adultscore=0 clxscore=1015 mlxscore=0 suspectscore=0 phishscore=0 mlxlogscore=765 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404260161 X-Spam-Status: No, score=-13.3 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+patchwork=sourceware.org@gcc.gnu.org When cfgexpand was changed to support expanding from tuple gimple (r0-95521-g28ed065ef9f345), the code was added to support doing nontemporal stores with LHS of a SSA_NAME but that will never be a nontemporal store. This patch removes that and asserts that expanding with a LHS of a SSA_NAME is not a nontemporal store. Bootstrapped and tested on x86_64-linux-gnu. gcc/ChangeLog: PR middle-end/112976 * cfgexpand.cc (expand_gimple_stmt_1): Remove support for expanding nontemporal "moves" with ssa names on the LHS. Signed-off-by: Andrew Pinski --- gcc/cfgexpand.cc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/gcc/cfgexpand.cc b/gcc/cfgexpand.cc index eef565eddb5..cfc5291aa0c 100644 --- a/gcc/cfgexpand.cc +++ b/gcc/cfgexpand.cc @@ -4002,17 +4002,16 @@ expand_gimple_stmt_1 (gimple *stmt) else { rtx target, temp; - bool nontemporal = gimple_assign_nontemporal_move_p (assign_stmt); + gcc_assert (!gimple_assign_nontemporal_move_p (assign_stmt)); bool promoted = false; target = expand_expr (lhs, NULL_RTX, VOIDmode, EXPAND_WRITE); if (GET_CODE (target) == SUBREG && SUBREG_PROMOTED_VAR_P (target)) promoted = true; - /* If we want to use a nontemporal store, force the value to - register first. If we store into a promoted register, - don't directly expand to target. */ - temp = nontemporal || promoted ? NULL_RTX : target; + /* If we store into a promoted register, don't directly + expand to target. */ + temp = promoted ? NULL_RTX : target; temp = expand_expr_real_gassign (assign_stmt, temp, GET_MODE (target), EXPAND_NORMAL); @@ -4034,8 +4033,6 @@ expand_gimple_stmt_1 (gimple *stmt) convert_move (SUBREG_REG (target), temp, unsignedp); } - else if (nontemporal && emit_storent_insn (target, temp)) - ; else { temp = force_operand (temp, target);