From patchwork Tue Sep 10 03:40:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 1982916 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=WRiPuIiB; 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 4X2qHh6C1fz1y1v for ; Tue, 10 Sep 2024 13:41:20 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D4B373857C4F for ; Tue, 10 Sep 2024 03:41:17 +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 7D8463858D39 for ; Tue, 10 Sep 2024 03:40:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7D8463858D39 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 7D8463858D39 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=1725939654; cv=none; b=evbpDAIBJ70S/eTaI6C30Hh9n8CB7bJvEwUV/B0AWEvYLIvLRHp2+V1ERV7mfznPz8nYQjSubMgbGhucj67251gJFvGJ0NhsdEohM1B66jYxZYqCjIFIWI+hP+hY3ayvFXCTD7nTJaaPX+mC1Jt9lkJFGcs4CWU0tSK5sm2CUN4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725939654; c=relaxed/simple; bh=KRKWpeujqENhDluoE/GJ5/pjMqYSK6tB0BEGqHH9ggs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=fvw/XjTy/AFTsUB3DvyFClXuBrV8k3aMApdHzh+CsjGyvRf/GvSLiACnAQAcDnEB14CjjtIMh42VQO6Z1dmPuvUisXHaRo9+WkEsuzZ/20kFZZFMM7CxsIMUou2NwsGuwYJ6OkEcjNzq6xDl6f4j+4qV+rIMi10Mc4zHwCo7ppA= 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 489DRQB8023788 for ; Tue, 10 Sep 2024 03:40:51 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=HHnudZcukNxYZCIgET10mv GXFNActFQszNs3/g09U5w=; b=WRiPuIiBvDL1Alnptxo6lk8elPIKOnAyshp8S+ /ps7RjMRxzPZS87gOfwLTOdScd1EAIpYpp+D3HqATZhXF72ZMG7d+rTUVpYDnKrE WR8HD/+3QjOrDD2FWz56+xtQohaiR1ydBut6kmlD3zEKOq2u9jfCDXa7ubT+yPXs sa9u6pkXNfH8zVYKi0i3FlmZJ3GdlHfQZHrxxHWhjXDgJZsLQHOe/i8E/Mo1GEuq J7nZhFddr8jDdCi3y5qb806T2NBKy7zv0nT1JO56IcVOuM61AZnkKX6NPtWlrg01 rhVjYmIw1ncztYzTFZL5afwpsK6KXHbka0/OY3xc8JuvmrrQ== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41gy6p4m05-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 10 Sep 2024 03:40:50 +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 48A3eosY025695 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 10 Sep 2024 03:40:50 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; Mon, 9 Sep 2024 20:40:49 -0700 From: Andrew Pinski To: CC: Andrew Pinski Subject: [PATCH 1/2] phiopt: Use gimple_phi_result rather than PHI_RESULT [PR116643] Date: Mon, 9 Sep 2024 20:40:35 -0700 Message-ID: <20240910034036.1984338-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: 9MHXQfwIpUNnRaEhXMAcFpdCkbhsJ9Br X-Proofpoint-GUID: 9MHXQfwIpUNnRaEhXMAcFpdCkbhsJ9Br 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 clxscore=1015 adultscore=0 bulkscore=0 lowpriorityscore=0 mlxlogscore=999 spamscore=0 phishscore=0 impostorscore=0 suspectscore=0 mlxscore=0 malwarescore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000 definitions=main-2409100025 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, RCVD_IN_DNSWL_NONE, 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 converts the uses of PHI_RESULT in phiopt to be gimple_phi_result instead. Since there was already a mismatch of uses here, it would be good to use prefered one (gimple_phi_result) instead. Bootstrapped and tested on x86_64-linux-gnu. PR tree-optimization/116643 gcc/ChangeLog: * tree-ssa-phiopt.cc (replace_phi_edge_with_variable): s/PHI_RESULT/gimple_phi_result/. (factor_out_conditional_operation): Likewise. (minmax_replacement): Likewise. (spaceship_replacement): Likewise. (cond_store_replacement): Likewise. (cond_if_else_store_replacement_1): Likewise. Signed-off-by: Andrew Pinski --- gcc/tree-ssa-phiopt.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc index 06ec5875722..bd8ede06a98 100644 --- a/gcc/tree-ssa-phiopt.cc +++ b/gcc/tree-ssa-phiopt.cc @@ -97,7 +97,7 @@ replace_phi_edge_with_variable (basic_block cond_block, { basic_block bb = gimple_bb (phi); gimple_stmt_iterator gsi; - tree phi_result = PHI_RESULT (phi); + tree phi_result = gimple_phi_result (phi); bool deleteboth = false; /* Duplicate range info if they are the only things setting the target PHI. @@ -373,7 +373,7 @@ factor_out_conditional_operation (edge e0, edge e1, gphi *phi, return NULL; /* Create a new PHI stmt. */ - result = PHI_RESULT (phi); + result = gimple_phi_result (phi); temp = make_ssa_name (TREE_TYPE (new_arg0), NULL); gimple_match_op new_op = arg0_op; @@ -1684,7 +1684,7 @@ minmax_replacement (basic_block cond_bb, basic_block middle_bb, basic_block alt_ tree smaller, larger, arg_true, arg_false; gimple_stmt_iterator gsi, gsi_from; - tree type = TREE_TYPE (PHI_RESULT (phi)); + tree type = TREE_TYPE (gimple_phi_result (phi)); gcond *cond = as_a (*gsi_last_bb (cond_bb)); enum tree_code cmp = gimple_cond_code (cond); @@ -2022,7 +2022,7 @@ minmax_replacement (basic_block cond_bb, basic_block middle_bb, basic_block alt_ /* Emit the statement to compute min/max. */ location_t locus = gimple_location (last_nondebug_stmt (cond_bb)); gimple_seq stmts = NULL; - tree phi_result = PHI_RESULT (phi); + tree phi_result = gimple_phi_result (phi); result = gimple_build (&stmts, locus, minmax, TREE_TYPE (phi_result), arg0, arg1); result = gimple_build (&stmts, locus, ass_code, TREE_TYPE (phi_result), @@ -2224,7 +2224,7 @@ minmax_replacement (basic_block cond_bb, basic_block middle_bb, basic_block alt_ /* Emit the statement to compute min/max. */ gimple_seq stmts = NULL; - tree phi_result = PHI_RESULT (phi); + tree phi_result = gimple_phi_result (phi); /* When we can't use a MIN/MAX_EXPR still make sure the expression stays in a form to be recognized by ISA that map to IEEE x > y ? x : y @@ -2298,7 +2298,7 @@ spaceship_replacement (basic_block cond_bb, basic_block middle_bb, edge e0, edge e1, gphi *phi, tree arg0, tree arg1) { - tree phires = PHI_RESULT (phi); + tree phires = gimple_phi_result (phi); if (!INTEGRAL_TYPE_P (TREE_TYPE (phires)) || TYPE_UNSIGNED (TREE_TYPE (phires)) || !tree_fits_shwi_p (arg0) @@ -3399,7 +3399,7 @@ cond_store_replacement (basic_block middle_bb, basic_block join_bb, add_phi_arg (newphi, rhs, e0, locus); add_phi_arg (newphi, name, e1, locus); - new_stmt = gimple_build_assign (lhs, PHI_RESULT (newphi)); + new_stmt = gimple_build_assign (lhs, gimple_phi_result (newphi)); /* 4) Insert that PHI node. */ gsi = gsi_after_labels (join_bb); @@ -3481,7 +3481,7 @@ cond_if_else_store_replacement_1 (basic_block then_bb, basic_block else_bb, add_phi_arg (newphi, then_rhs, EDGE_SUCC (then_bb, 0), then_locus); add_phi_arg (newphi, else_rhs, EDGE_SUCC (else_bb, 0), else_locus); - new_stmt = gimple_build_assign (lhs, PHI_RESULT (newphi)); + new_stmt = gimple_build_assign (lhs, gimple_phi_result (newphi)); /* 3) Insert that PHI node. */ gsi = gsi_after_labels (join_bb);