From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 499FE3857C63 for ; Wed, 22 Jul 2020 07:08:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 499FE3857C63 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 06M74iWW126351; Wed, 22 Jul 2020 03:08:10 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 32e11n1gg1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Jul 2020 03:08:10 -0400 Received: from m0098394.ppops.net (m0098394.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 06M751d9128161; Wed, 22 Jul 2020 03:08:09 -0400 Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 32e11n1gey-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Jul 2020 03:08:09 -0400 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 06M76p6H031980; Wed, 22 Jul 2020 07:08:07 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma03fra.de.ibm.com with ESMTP id 32brq82etb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Jul 2020 07:08:07 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 06M76fbV61079970 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Jul 2020 07:06:41 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3AACFA405C; Wed, 22 Jul 2020 07:08:05 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 48677A405F; Wed, 22 Jul 2020 07:08:03 +0000 (GMT) Received: from KewenLins-MacBook-Pro.local (unknown [9.197.238.225]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 22 Jul 2020 07:08:02 +0000 (GMT) Subject: Re: [PATCH v2] vect/rs6000: Support vector with length cost modeling To: Richard Biener Cc: GCC Patches , Bill Schmidt , Segher Boessenkool , Richard Sandiford References: <419f1fad-05be-115c-1a53-cb710ae7b2dc@linux.ibm.com> From: "Kewen.Lin" Message-ID: <6b7ad1e4-b844-54c1-dce7-f32c29e08a41@linux.ibm.com> Date: Wed, 22 Jul 2020 15:08:01 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-07-22_03:2020-07-22, 2020-07-22 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 impostorscore=0 phishscore=0 bulkscore=0 mlxlogscore=999 priorityscore=1501 spamscore=0 malwarescore=0 clxscore=1015 mlxscore=0 adultscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007220052 X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, 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-List-Received-Date: Wed, 22 Jul 2020 07:08:15 -0000 Hi Richard, on 2020/7/22 下午2:38, Richard Biener wrote: > On Wed, Jul 22, 2020 at 3:26 AM Kewen.Lin wrote: >> >> Hi Richard, >> >> on 2020/7/21 下午3:57, Richard Biener wrote: >>> On Tue, Jul 21, 2020 at 7:52 AM Kewen.Lin wrote: >>>> >>>> Hi, >>>> >>>> This patch is to add the cost modeling for vector with length, >>>> it mainly follows what we generate for vector with length in >>>> functions vect_set_loop_controls_directly and vect_gen_len >>>> at the worst case. >>>> >>>> For Power, the length is expected to be in bits 0-7 (high bits), >>>> we have to model the cost of shifting bits. To allow other targets >>>> not suffer this, I used one target hook to describe this extra cost, >>>> I'm not sure if it's a correct way. >>>> >>>> Bootstrapped/regtested on powerpc64le-linux-gnu (P9) with explicit >>>> param vect-partial-vector-usage=1. >>>> >>>> Any comments/suggestions are highly appreciated! >>> >>> I don't like the introduction of an extra target hook for this. All >>> vectorizer cost modeling should ideally go through >>> init_cost/add_stmt_cost/finish_cost. If the extra costing is >>> not per stmt then either init_cost or finish_cost is appropriate. >>> Currently init_cost only gets a struct loop while we should >>> probably give it a vec_info * parameter so targets can >>> check LOOP_VINFO_USING_PARTIAL_VECTORS_P and friends. >>> >> >> Thanks! Nice, your suggested way looks better. I've removed the hook >> and taken care of it in finish_cost. The updated v2 is attached. >> >> Bootstrapped/regtested again on powerpc64le-linux-gnu (P9) with explicit >> param vect-partial-vector-usage=1. > > LGTM (with assuming the first larger hunk is mostly re-indenting > under LOOP_VINFO_USING_PARTIAL_VECTORS_P). Thanks for the review! Yes, for the original LOOP_VINFO_FULLY_MASKED_P hunk, this patch moves the handling of gap peeling to be shared between mask and length, and re-indent the remaining (masking specific) into inner LOOP_VINFO_FULLY_MASKED_P. The length specific is put into the else hunk. It wouldn't change anything for masking, I'll run aarch64 regtesting to ensure it. :) BR, Kewen