From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 67BC2385703B for ; Mon, 27 Jul 2020 03:44:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 67BC2385703B 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 06R3Ve9d018941; Sun, 26 Jul 2020 23:44:27 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 32ggmf72y4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 26 Jul 2020 23:44:27 -0400 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 06R3doFp036521; Sun, 26 Jul 2020 23:44:27 -0400 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 32ggmf72xm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 26 Jul 2020 23:44:26 -0400 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 06R3fPsD000710; Mon, 27 Jul 2020 03:44:25 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma04ams.nl.ibm.com with ESMTP id 32gcy4hrcw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Jul 2020 03:44:25 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 06R3iNYJ50659590 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Jul 2020 03:44:23 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 02C18AE051; Mon, 27 Jul 2020 03:44:23 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 20BE5AE045; Mon, 27 Jul 2020 03:44:21 +0000 (GMT) Received: from KewenLins-MacBook-Pro.local (unknown [9.200.54.160]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 27 Jul 2020 03:44:20 +0000 (GMT) Subject: Re: [PATCH v2] vect/rs6000: Support vector with length cost modeling To: Segher Boessenkool Cc: Richard Biener , GCC Patches , Bill Schmidt , Richard Sandiford References: <419f1fad-05be-115c-1a53-cb710ae7b2dc@linux.ibm.com> <20200722174931.GB32057@gate.crashing.org> From: "Kewen.Lin" Message-ID: <1c45f889-23ca-c4dc-88a7-cc7b9aa6990b@linux.ibm.com> Date: Mon, 27 Jul 2020 11:44:19 +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: <20200722174931.GB32057@gate.crashing.org> Content-Type: text/plain; charset=gbk 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-27_02:2020-07-24, 2020-07-27 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 mlxscore=0 lowpriorityscore=0 impostorscore=0 spamscore=0 clxscore=1015 phishscore=0 mlxlogscore=999 priorityscore=1501 adultscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007270021 X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, MIME_CHARSET_FARAWAY, 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: Mon, 27 Jul 2020 03:44:30 -0000 Hi Segher, Thanks for the comments! on 2020/7/23 ÉÏÎç1:49, Segher Boessenkool wrote: > Hi! > > On Wed, Jul 22, 2020 at 09:26:39AM +0800, Kewen.Lin wrote: >> +/* For some target specific vectorization cost which can't be handled per stmt, >> + we check the requisite conditions and adjust the vectorization cost >> + accordingly if satisfied. One typical example is to model shift cost for >> + vector with length by counting number of required lengths under condition >> + LOOP_VINFO_FULLY_WITH_LENGTH_P. */ >> + >> +static void >> +adjust_vect_cost (rs6000_cost_data *data) >> +{ > > Maybe call it rs6000_adjust_vect_cost? For consistency, but also it > could (in the future) collide with a globalfunction of the same name (it > is a very non-specific name). Done in v4, used rs6000_adjust_vect_cost_per_loop. > >> + /* Each length needs one shift to fill into bits 0-7. */ >> + shift_cnt += (num_vectors_m1 + 1); > > That doesn't need parentheses. Done in v4. > >> if (cost_data->loop_info) >> - rs6000_density_test (cost_data); >> + { >> + adjust_vect_cost (cost_data); >> + rs6000_density_test (cost_data); >> + } > > ^^^ consistency :-) > > The rs6000 parts are fine for trunk, thanks! Thanks! BR, Kewen