From patchwork Tue Nov 21 08:30:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Agarwal X-Patchwork-Id: 167552 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp476356vqb; Tue, 21 Nov 2023 00:31:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IGB2v+DeVrpb9W44PbCY02Yz4/RGCC5yCs0d5EEJe6f6z6vTb9Mh1wUPIRkMJTVOQwiu/Oi X-Received: by 2002:a05:6359:6f94:b0:16d:e746:6e07 with SMTP id tl20-20020a0563596f9400b0016de7466e07mr2189727rwb.21.1700555466234; Tue, 21 Nov 2023 00:31:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700555466; cv=pass; d=google.com; s=arc-20160816; b=CkJx+ek+k8vY2pKidq7ZJYIrLwzml5kxFMi2JGo+BNIiliC4QN5tFBuhMvmEQnOiQv qI63Va+cEll9tLdqP7Si4KjYx2H6HpUjIcRF63ON9dQZRL4NOCBtI91cwlLNAd72U3uW Ai95rhb8O3cZ95wUwTrYZpBLR74VxX5bGamsbYEFhfgpH01XuIq2GnCUljx2OlsLrOd7 rd6JgoYQdgIJsJ5QHg8B/d4n+j41+ZgkPCuxn0cSQBCto77rRYvGrAFKpr9Hex30/fDv QFWitFVpJleU860EHcyZPk0L0/q4a+KS7D2GAfoUVQgIUKNd5gDImLpHbDO1MGsnj/xj dcgg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :subject:from:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=R0PJ98lNihJAm+TiqMhbYJUDGjVVTPrwbti8Em2a6kQ=; fh=lkWBmTwOkZC85Z+19IvKdNmJewuJfAahtUh3ymzZVYI=; b=0MXxA2s6SqpM8UF0NABIOuIC3HA8EJ8RyNxaJpxO9HD3Cs6Mm0Aj5lFil99R45TvWo o8ZuODBU8vBeuQutOy2Td25BckG/iEYbhm4bkhcxCXJc5GUfiPcBcJJMfxvZFB/w1CTc 860TiBrdEGIoow8c6E1Jz2VjuIUNqoM7I5KPreGLnvt0yhBpUnmNkASBjfXeHd5hrPX9 rW8ivKXybCuCnhyaZMcL2j9AhAf6lDkRKTMunOD9w72M97KeUvMKVP/NJEKoQBFd/etx +9fF5bIm0XOVbEoQ3i8EI6yhq+dzl3vtJeCpTaqLFXvSCgU/ZTK8UENCTqwqnYd01AyZ RNPw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=nKHF7XBx; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id d17-20020a05622a15d100b00417b7f7dfb9si9082684qty.228.2023.11.21.00.31.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 00:31:06 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=nKHF7XBx; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EEF7A3858410 for ; Tue, 21 Nov 2023 08:31:05 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 06D2E3858D37 for ; Tue, 21 Nov 2023 08:30:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 06D2E3858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 06D2E3858D37 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700555425; cv=none; b=dEvmvaFp+sjWdhsFpe6tTNEEWI0L5AH2TSBQbZ+Z+a5ahf4xSqCtbz+X1v3rD1Ko4/kzI1hG1uQrDX0JroouDYpZ2DN+AqEcYENKJ/7o9Z/GQcVfZ4H/ZHWu4ApeACF0oeWFoc/966Lkg6WTl3G2MRq19p4zHVEJKRr9UlNLSZg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700555425; c=relaxed/simple; bh=+PjXiumGuJzkMMOafLIbGDuOjYoGW7YOpbs3bJjownI=; h=DKIM-Signature:Message-ID:Date:MIME-Version:To:From:Subject; b=gknVTDv0uQIjsG3RXMz25GbHIgDlF+jXtZbfWKqJl8QXZQd7nP873cR0MjOPIiDb7hnMyN5v0/G6k/KE1aCnSGU6LRw+0SGPUOhTCiKz44ljw3MQjbFYK9UoqXtsJjdwRF++U8yO0oMeX3ozvzCzMrIFlkqzgNlp/PiqzhSZVP4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AL7vdkI030844; Tue, 21 Nov 2023 08:30:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : to : cc : from : subject : content-type : content-transfer-encoding; s=pp1; bh=R0PJ98lNihJAm+TiqMhbYJUDGjVVTPrwbti8Em2a6kQ=; b=nKHF7XBxTSnijgwPBOyqgwD+kQHB8RWFU/FCnq2iuqoIhlhrIqLchJ7O3g3G7OcXSMU8 COy0t6M4R5m5wFxrOzrtC1LNkdBM/HTd76htdl20uXsPhVGnSL5kJk38p53K0444xNvS RXSPViNw/rYZIOBFIKqD7TU2uAwguMrYmvXa5CPXqlez98e+8sZogqrJsxe+gRVKfSuH NL7u14L8j52F4mWiGi7d5ez+8WI4G9nstPHrriWw4xYV42e5+ZVXCykJXJFue6FnFGtT U/6D8Un2HsHGqke79v+mhvL+4PyYd2TO1c3vObF7u1TxNPyvnCgpfDtvHvY/x1yhoxUa gQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ugrma10e7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 21 Nov 2023 08:30:23 +0000 Received: from m0353724.ppops.net (m0353724.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3AL8HGJ9004310; Tue, 21 Nov 2023 08:30:22 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ugrma10d5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 21 Nov 2023 08:30:22 +0000 Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3AL6J7Zp021223; Tue, 21 Nov 2023 08:30:21 GMT Received: from smtprelay02.wdc07v.mail.ibm.com ([172.16.1.69]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3uf93kq72v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 21 Nov 2023 08:30:21 +0000 Received: from smtpav01.wdc07v.mail.ibm.com (smtpav01.wdc07v.mail.ibm.com [10.39.53.228]) by smtprelay02.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3AL8ULFd18481830 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 21 Nov 2023 08:30:21 GMT Received: from smtpav01.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2B11C5805B; Tue, 21 Nov 2023 08:30:21 +0000 (GMT) Received: from smtpav01.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CDFC158059; Tue, 21 Nov 2023 08:30:18 +0000 (GMT) Received: from [9.43.7.24] (unknown [9.43.7.24]) by smtpav01.wdc07v.mail.ibm.com (Postfix) with ESMTP; Tue, 21 Nov 2023 08:30:18 +0000 (GMT) Message-ID: <033c8799-cbdf-4d57-8d96-af33841d1a4f@linux.ibm.com> Date: Tue, 21 Nov 2023 14:00:17 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: gcc-patches Cc: Richard Biener , Jeff Law , Segher Boessenkool , Peter Bergner From: Ajit Agarwal Subject: [PATCH] rtl-optimization: Modify loop live data with livein of loop header X-TM-AS-GCONF: 00 X-Proofpoint-GUID: ecm5RTB6r_72Wa19JGyhpuuGPotQbYF- X-Proofpoint-ORIG-GUID: lqyOkQkuRBA_0eygLqkJ9TlJm7eNMCUu X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-21_03,2023-11-20_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 phishscore=0 adultscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 clxscore=1015 mlxscore=0 impostorscore=0 mlxlogscore=808 priorityscore=1501 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311210065 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783161648256092510 X-GMAIL-MSGID: 1783161648256092510 Hello All: This patch marked LOOP_DATA->live as the livein at the loop header basic block. This is because Livein at each basic block is live in at the loop header. Bootstrapped and regtested on powerpc64-linux-gnu. SPEC CPU 2017 benchmarks score is better than trunk wit this change for INT and FP benchmarks. THanks & Regards Ajit rtl-optimization: Modify loop live data with livein of loop header Livein at each basic block is live in at the loop header. Marked LOOP_DATA->live as the livein at the loop header basic block. 2023-11-21 Ajit Kumar Agarwal gcc/ChangeLog: * loop-invariant.cc (calculate_loop_reg_pressure): Mark LOOP_DATA->live as the livein at the loop header basic block. --- gcc/loop-invariant.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gcc/loop-invariant.cc b/gcc/loop-invariant.cc index a9b156682bc..c15e6168d5d 100644 --- a/gcc/loop-invariant.cc +++ b/gcc/loop-invariant.cc @@ -2169,17 +2169,18 @@ calculate_loop_reg_pressure (void) } ira_setup_eliminable_regset (); bitmap_initialize (&curr_regs_live, ®_obstack); + + /* Livein (loop_hdr) is live at each of the loop basic blocks. */ + for (auto loop : loops_list (cfun, 0)) + if (loop->aux == NULL) + bitmap_ior_into (&LOOP_DATA (loop)->regs_live, DF_LR_IN (loop->header)); + FOR_EACH_BB_FN (bb, cfun) { curr_loop = bb->loop_father; if (curr_loop == current_loops->tree_root) continue; - for (class loop *loop = curr_loop; - loop != current_loops->tree_root; - loop = loop_outer (loop)) - bitmap_ior_into (&LOOP_DATA (loop)->regs_live, DF_LR_IN (bb)); - bitmap_copy (&curr_regs_live, DF_LR_IN (bb)); for (i = 0; i < ira_pressure_classes_num; i++) curr_reg_pressure[ira_pressure_classes[i]] = 0;