From patchwork Wed Oct 9 06:43:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kewen.Lin" X-Patchwork-Id: 1173619 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-510510-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="Zl/60YaQ"; 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 46p4Rc5NKyz9s7T for ; Wed, 9 Oct 2019 17:43:22 +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 :subject:from:to:cc:references:date:mime-version:in-reply-to :content-type:content-transfer-encoding:message-id; q=dns; s= default; b=KMRJyamlzynUofu/kaTmut5Ze9GoRaSJArOi8vg2ZpVZV62uq9jKY 73tw8N7B6vpHLkjC6TraUhFlN8lK9J/R/a0wlD646Zq7lEftG9JSSGT4WKe1ar/W m1TueFVYZHbfyZNSQ3tCH4maRWscB59+1TseyAvdyEJgBC6utdD00E= 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 :subject:from:to:cc:references:date:mime-version:in-reply-to :content-type:content-transfer-encoding:message-id; s=default; bh=q8hew0NBm6C8So0bz7PXAYKhdZc=; b=Zl/60YaQYgWG1+WHElmxMMlQeW0c PmRWKTSbJY69O1CjbVbpylShyEgqGWFCtOiViJEpWC9jxUmNte4TLPsVKH9FLIY8 58Gool7IQE65/7KSelWZibb9hniJWw2mQcehRY7+sLqyC+BMhbf9CvYAv5WEbmbe mJYMzP1BpmhvdKU= Received: (qmail 68781 invoked by alias); 9 Oct 2019 06:43:14 -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 68773 invoked by uid 89); 9 Oct 2019 06:43:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.5 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=H*UA:Macintosh, H*u:Macintosh 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; Wed, 09 Oct 2019 06:43:13 +0000 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x996ftAF061781 for ; Wed, 9 Oct 2019 02:43:11 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0b-001b2d01.pphosted.com with ESMTP id 2vh7j6n99d-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 09 Oct 2019 02:43:11 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 9 Oct 2019 07:43:09 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 9 Oct 2019 07:43:07 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x996h5d854657090 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 9 Oct 2019 06:43:05 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4A14211C050; Wed, 9 Oct 2019 06:43:05 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1190E11C04C; Wed, 9 Oct 2019 06:43:04 +0000 (GMT) Received: from kewenlins-mbp.cn.ibm.com (unknown [9.200.147.60]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 9 Oct 2019 06:43:03 +0000 (GMT) Subject: [PATCH, rs6000] Lower vec_promote_demote vectorization cost for P8/P9 From: "Kewen.Lin" To: GCC Patches Cc: Segher Boessenkool , Bill Schmidt References: <562230cb-ec3c-e46c-f59f-b7d69f3000b7@linux.ibm.com> Date: Wed, 9 Oct 2019 14:43:02 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <562230cb-ec3c-e46c-f59f-b7d69f3000b7@linux.ibm.com> x-cbid: 19100906-0028-0000-0000-000003A857E5 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19100906-0029-0000-0000-0000246A5B17 Message-Id: <804b71d6-40c3-7c0d-8bfa-b347a7b7fda4@linux.ibm.com> X-IsSubscribed: yes Hi, This patch is to lower vec_promote_demote vectorization cost in rs6000_builtin_vectorization_cost. It's similar to what we committed for vec_perm, the current cost for vec_promote_demote is also overpriced for Power8 and Power9 since Power8 and Power9 has supported more units for permute/unpack/pack rather than single one on Power7. The performance evaluation on SPEC2017 Power9 shows +2.88% gain on 525.x264_r, degraded -1.70% on 526.blender_r but which has been identified as just exposing some other issues and actually unrelated, while SPEC2017 Power8 evaluation shows +4.63% gain on 525.x264_r without any significant degradations, SPEC2006 Power8 evaluation shows 1.99% gain on 453.povray. The geomean gain for SPEC2017 on both Power8 and Power9 is +0.06%, and it's unchanged for SPEC2006 Power8. Bootstrapped and regress tested on powerpc64le-linux-gnu. Is OK for trunk? Thanks, Kewen gcc/ChangeLog 2019-10-09 Kewen Lin * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): Lower vec_promote_demote cost to 1 for non-Power7 VSX architectures. ---- diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 2fd9808..8040577 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -4781,10 +4781,11 @@ rs6000_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost, return 1; case vec_promote_demote: - if (TARGET_VSX) - return 4; - else - return 1; + /* Power7 has only one permute/pack unit, make it a bit expensive. */ + if (TARGET_VSX && rs6000_tune == PROCESSOR_POWER7) + return 4; + else + return 1; case cond_branch_taken: return 3;