From patchwork Mon Apr 20 13:57:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiufu Guo X-Patchwork-Id: 1273441 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=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=RbFT+Gq8; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 495SvF5L01z9sP7 for ; Mon, 20 Apr 2020 23:57:43 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6A32C3870863; Mon, 20 Apr 2020 13:57:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6A32C3870863 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1587391061; bh=k/lJTIYwLZhtcSiLBr8iik4I55oN7Q8V7aga9Sh06tw=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=RbFT+Gq8z9YxR2IBzd5M+8bnObb0DOeP1lc+H+bDx8QMZqii4AbEWWNgmbyRNg559 RAL673BxKFwJuJroibgzy6SO+yjofIrq9w26ekhoBUd7TJBOuQ4QJBcRL/Uup46wyE F+tJhoUn0X8GtElqSqlHVkHVAkuhMa3vhLgTQY/g= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 69E75386F838 for ; Mon, 20 Apr 2020 13:57:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 69E75386F838 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03KDWADs139996 for ; Mon, 20 Apr 2020 09:57:39 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 30gg26n78d-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 20 Apr 2020 09:57:38 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 20 Apr 2020 14:56:52 +0100 Received: from b06avi18626390.portsmouth.uk.ibm.com (9.149.26.192) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 20 Apr 2020 14:56:50 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 03KDuQj036831692 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 20 Apr 2020 13:56:26 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5E4DE11C050; Mon, 20 Apr 2020 13:57:33 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9342811C04A; Mon, 20 Apr 2020 13:57:32 +0000 (GMT) Received: from genoa.aus.stglabs.ibm.com (unknown [9.40.192.157]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 20 Apr 2020 13:57:32 +0000 (GMT) To: gcc-patches@gcc.gnu.org Subject: [PATCH,rs6000] enable -fweb for small loops unrolling Date: Mon, 20 Apr 2020 21:57:31 +0800 X-Mailer: git-send-email 2.17.1 X-TM-AS-GCONF: 00 x-cbid: 20042013-0016-0000-0000-00000307FC77 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20042013-0017-0000-0000-0000336C0E73 Message-Id: <20200420135731.65650-1-guojiufu@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-20_04:2020-04-20, 2020-04-20 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 malwarescore=0 suspectscore=1 spamscore=0 priorityscore=1501 clxscore=1015 adultscore=0 lowpriorityscore=0 bulkscore=0 mlxlogscore=999 impostorscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004200114 X-Spam-Status: No, score=-25.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: guojiufu via Gcc-patches From: Jiufu Guo Reply-To: guojiufu Cc: wschmidt@linux.ibm.com, segher@kernel.crashing.org Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi, Previously -fweb was disabled if only unroll small loops. After that we find there is cases where it could help to rename pseudos and aovid some anti-dependence which may occur after unroll. Below is a patch to disable -fweb during loop unrolling. Bootstrap and regtest pass on powerpc, spec2017 run shows no performance downgrade. Is this ok for trunk? BR, Jiufu gcc/ 2020-04-20 Jiufu Guo * common/config/rs6000/rs6000-common.c (rs6000_option_optimization_table)[OPT_LEVELS_ALL]: Remove turn off -fweb. * config/rs6000/rs6000.c (rs6000_option_override_internal): Avoid to set flag_web. --- gcc/common/config/rs6000/rs6000-common.c | 5 ++--- gcc/config/rs6000/rs6000.c | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/gcc/common/config/rs6000/rs6000-common.c b/gcc/common/config/rs6000/rs6000-common.c index 4f38d566844..87f7fda940a 100644 --- a/gcc/common/config/rs6000/rs6000-common.c +++ b/gcc/common/config/rs6000/rs6000-common.c @@ -38,9 +38,8 @@ 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 }, + + /* -frename-registers is not very helpful for rs6000, turn it off. */ { OPT_LEVELS_ALL, OPT_frename_registers, NULL, 0 }, /* Double growth factor to counter reduced min jump length. */ diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index a2992e682c8..6a9e701bd60 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -4543,7 +4543,7 @@ rs6000_option_override_internal (bool global_init_p) SCHED_PRESSURE_MODEL); /* Explicit -funroll-loops turns -munroll-only-small-loops off, and - turns -fweb and -frename-registers on. */ + turns -frename-registers on. */ if ((global_options_set.x_flag_unroll_loops && flag_unroll_loops) || (global_options_set.x_flag_unroll_all_loops && flag_unroll_all_loops)) @@ -4552,8 +4552,6 @@ rs6000_option_override_internal (bool global_init_p) unroll_only_small_loops = 0; if (!global_options_set.x_flag_rename_registers) flag_rename_registers = 1; - if (!global_options_set.x_flag_web) - flag_web = 1; } /* If using typedef char *va_list, signal that