[0/3] Dependency patches for hoist LIM code to cold loop
Message ID | 20211208055416.1415283-1-luoxhu@linux.ibm.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 14C893858C39 for <patchwork@sourceware.org>; Wed, 8 Dec 2021 05:55:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 14C893858C39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1638942919; bh=aRCJkNOeC/T7bKUzNSvvlv//sAHQ6Fikgh3/SIExXCM=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=OsFBv+5Ib9/Yth7aDCuoFfF6BuiVSxCGszlZWiikcaLFn9tKjYFatLhd2V+DQTkxs iM14ic2A4VMsfJMhbw9b+U0spm8Cpa1qk5icPIFLd+GTSF4wgkJpqsCRsWrd5x1w9w QXArZBe3ne9FRWBA+DDZrHp6SvEAfRajr2fHD5ZA= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 9960A3858D28; Wed, 8 Dec 2021 05:54:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9960A3858D28 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1B85qiSh030733; Wed, 8 Dec 2021 05:54:48 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3ctpxqr10p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Dec 2021 05:54:48 +0000 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1B85sllg002304; Wed, 8 Dec 2021 05:54:47 GMT Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0a-001b2d01.pphosted.com with ESMTP id 3ctpxqr109-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Dec 2021 05:54:47 +0000 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1B85rqYP022876; Wed, 8 Dec 2021 05:54:45 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma06fra.de.ibm.com with ESMTP id 3cqykftxg5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Dec 2021 05:54:45 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1B85sf7229622714 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 8 Dec 2021 05:54:41 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A7B5D5204F; Wed, 8 Dec 2021 05:54:41 +0000 (GMT) Received: from genoa.aus.stglabs.ibm.com (unknown [9.40.192.157]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 3A52B52052; Wed, 8 Dec 2021 05:54:40 +0000 (GMT) To: gcc-patches@gcc.gnu.org Subject: [PATCH 0/3] Dependency patches for hoist LIM code to cold loop Date: Tue, 7 Dec 2021 23:54:13 -0600 Message-Id: <20211208055416.1415283-1-luoxhu@linux.ibm.com> X-Mailer: git-send-email 2.25.1 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 17PtzMOkgBJqmLMlNiFsGC0v1M5CtOEU X-Proofpoint-ORIG-GUID: 3IzxOaVEtrmnmUP_uOeHpqT2X4vual04 Content-Transfer-Encoding: 8bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-08_01,2021-12-06_02,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 clxscore=1015 mlxscore=0 mlxlogscore=999 priorityscore=1501 lowpriorityscore=0 adultscore=0 phishscore=0 impostorscore=0 malwarescore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112080038 X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, KAM_SHORT, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 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> From: Xionghu Luo via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Xionghu Luo <luoxhu@linux.ibm.com> Cc: segher@kernel.crashing.org, Xionghu Luo <luoxhu@linux.ibm.com>, hubicka@kam.mff.cuni.cz, wschmidt@linux.ibm.com, linkw@gcc.gnu.org, dje.gcc@gmail.com Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Message
Xionghu Luo
Dec. 8, 2021, 5:54 a.m. UTC
This patchset is a recollect of previously sent patches. Thanks Richard that The "Don't move cold code out of loop by checking bb count" is approved[1], but there are still 3 prerequesite patches to supplement or avoid regression. 1) Patch [1/3] is the RTL part of not hoisting LIM code out of cold loop, it could improve perlbench by 7.69% [2]. 2) Patch [2/3] is a test case regression fix for pr103270.c, after enabling gimple part of hoisting LIM code to coldest loop [1], the store instruction in loop won't be moved out of inner loop, it is caused by a jump-threading patch unexpectedly turning a hot inner loop to cold loop, this patch could recover the inner loop to be hot[3]. 3) As data showed in [2], besides improvement, there is also a small regression on SPEC2017 544.nab_r (-1.55%). After investigation, it turned out to be the profile count and probability is not correctly adjusted in loop split, with this patch [3/3], the only regression is also fixed. This version slightly updates [4] to fix ICEs. [1] https://gcc.gnu.org/pipermail/gcc-patches/2021-December/586319.html [2] https://gcc.gnu.org/pipermail/gcc-patches/2021-September/580109.html [3] https://gcc.gnu.org/pipermail/gcc-patches/2021-November/585195.html [4] https://gcc.gnu.org/pipermail/gcc-patches/2021-November/585290.html Xionghu Luo (3): loop-invariant: Don't move cold bb instructions to preheader in RTL Fix incorrect loop exit edge probability [PR103270] Fix loop split incorrect count and probability gcc/loop-invariant.c | 10 ++-- gcc/predict.c | 10 ++-- gcc/tree-ssa-loop-split.c | 85 +++++++++++++++++++++++++++++---- gcc/testsuite/gcc.dg/pr103270.c | 19 ++++++++ 4 files changed, 109 insertions(+), 15 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/pr103270.c