From patchwork Fri Dec 20 06:34:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiufu Guo X-Patchwork-Id: 1213933 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-516349-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="qP61gBX0"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47fJr31g5jz9s4Y for ; Fri, 20 Dec 2019 17:34:24 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; q=dns; s=default; b=IfgY2/bU704j JVjo13k48b2p0a/PNSb7wL/HzcxLjAcMgyPpQ2/Rl5ntQrdARFcsvvKUIe3NO4ff TBJx/jRhCmOYriNxxpxhv1cCKmIBaBs8i8QkheUYs5rS2k0UMxEptjENKYX/z0lR D+TXWScMvL5JqFxB+EvYU2wwFdY/INA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; s=default; bh=2e3YDD3hFSXZ4iQPLS WuS9bDqe8=; b=qP61gBX0ONsWNQ+P+EQmIPgEPwGohHNC2k+0ilGpOvp1bs7Hvu h5TiA24XcpXmKR2jD/mOu/HXmVf4dG3lZ9oZmrTjo8qjhPQ0h1b/uwiupXenDs7p jy3A8a3tPBANTyOngIHJcJbqpE6dY7O3JKzKRtv76Sr/ZQCBYnE0pvmw0= Received: (qmail 27147 invoked by alias); 20 Dec 2019 06:34:17 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 27139 invoked by uid 89); 20 Dec 2019 06:34:17 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=2019-12-20, church, sk:rs6000_, Church X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 20 Dec 2019 06:34:15 +0000 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xBK6XUbo081958 for ; Fri, 20 Dec 2019 01:34:14 -0500 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 2x0qnqk8cw-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 20 Dec 2019 01:34:13 -0500 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 20 Dec 2019 06:34:12 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 20 Dec 2019 06:34:08 -0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id xBK6Y72U28573932 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Dec 2019 06:34:07 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1B386AE045; Fri, 20 Dec 2019 06:34:07 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5469FAE056; Fri, 20 Dec 2019 06:34:06 +0000 (GMT) Received: from genoa.aus.stglabs.ibm.com (unknown [9.40.192.157]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 20 Dec 2019 06:34:06 +0000 (GMT) From: Jiufu Guo To: gcc-patches@gcc.gnu.org Cc: guojiufu@linux.ibm.com, wschmidt@linux.ibm.com, segher@kernel.crashing.org Subject: [PATCH] enable -fweb and -frename-registers at -O3 for rs6000 Date: Fri, 20 Dec 2019 14:34:05 +0800 x-cbid: 19122006-0008-0000-0000-00000342CF95 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19122006-0009-0000-0000-00004A62EBBC Message-Id: <1576823645-73942-1-git-send-email-guojiufu@linux.ibm.com> X-IsSubscribed: yes Hi, Previously, limited unrolling was enabled at O2 for powerpc in r278034. At that time, -fweb and -frename-registers were not enabled together with -funroll-loops even for -O3. After that, we notice there are some performance degradation on SPEC2006fp which caused by without web and rnreg. This patch enable -fweb and -frename-registers for -O3 to align original behavior before r278034. Since this patch help to prevent performance regression, I'm thinking to submit to trunk. Bootstrap and regtest pass on powerpc64le. Is this okay for trunk? Thanks, Jiufu gcc/ 2019-12-20 Jiufu Guo * gcc/common/config/rs6000/rs6000-common.c (rs6000_option_optimization_table) [OPT_LEVELS_ALL]: Remove disabling -fweb and -frename-registers. [OPT_LEVELS_3_PLUS]: Enable -fweb and -frename-registers. gcc.testsuite/ 2019-12-20 Jiufu Guo * gcc.dg/torture/stackalign/builtin-return-1.c: Add option -fno-rename-registers for powerpc. --- gcc/common/config/rs6000/rs6000-common.c | 7 +++---- gcc/testsuite/gcc.dg/torture/stackalign/builtin-return-1.c | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gcc/common/config/rs6000/rs6000-common.c b/gcc/common/config/rs6000/rs6000-common.c index eb0328d..75a7caf 100644 --- a/gcc/common/config/rs6000/rs6000-common.c +++ b/gcc/common/config/rs6000/rs6000-common.c @@ -38,10 +38,9 @@ static const struct default_options rs6000_option_optimization_table[] = loops at -O2 and above by default. */ { OPT_LEVELS_2_PLUS_SPEED_ONLY, OPT_funroll_loops, NULL, 1 }, { OPT_LEVELS_2_PLUS_SPEED_ONLY, OPT_munroll_only_small_loops, NULL, 1 }, - /* -fweb and -frename-registers are useless in general for rs6000, - turn them off. */ - { OPT_LEVELS_ALL, OPT_fweb, NULL, 0 }, - { OPT_LEVELS_ALL, OPT_frename_registers, NULL, 0 }, + /* -fweb and -frename-registers are useful only above -O3 for rs6000. */ + { OPT_LEVELS_3_PLUS, OPT_fweb, NULL, 1 }, + { OPT_LEVELS_3_PLUS, OPT_frename_registers, NULL, 1 }, /* Double growth factor to counter reduced min jump length. */ { OPT_LEVELS_ALL, OPT__param_max_grow_copy_bb_insns_, NULL, 16 }, diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/builtin-return-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/builtin-return-1.c index ec4fd8a..4e342c0 100644 --- a/gcc/testsuite/gcc.dg/torture/stackalign/builtin-return-1.c +++ b/gcc/testsuite/gcc.dg/torture/stackalign/builtin-return-1.c @@ -2,6 +2,7 @@ /* Originator: Andrew Church */ /* { dg-do run } */ /* { dg-require-effective-target untyped_assembly } */ +/* { dg-additional-options "-fno-rename-registers" { target { powerpc*-*-* } } } */ /* This used to fail on SPARC because the (undefined) return value of 'bar' was overwriting that of 'foo'. */