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 3805C385DC00 for ; Wed, 3 Jun 2020 03:46:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3805C385DC00 Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0533VVDO195195; Tue, 2 Jun 2020 23:46:39 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 31c5410kqc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 Jun 2020 23:46:39 -0400 Received: from m0127361.ppops.net (m0127361.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 0533W8ZB196233; Tue, 2 Jun 2020 23:46:38 -0400 Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com with ESMTP id 31c5410kpu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 Jun 2020 23:46:38 -0400 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0533aTaW015004; Wed, 3 Jun 2020 03:46:36 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma01fra.de.ibm.com with ESMTP id 31bf47txg9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 03 Jun 2020 03:46:36 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0533kY2355050446 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 3 Jun 2020 03:46:34 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6E82BA4051; Wed, 3 Jun 2020 03:46:34 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4E2DAA404D; Wed, 3 Jun 2020 03:46:32 +0000 (GMT) Received: from KewenLins-MacBook-Pro.local (unknown [9.200.52.51]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 3 Jun 2020 03:46:31 +0000 (GMT) Subject: Re: [PATCH 0/4] IVOPTs consider step cost for different forms when unrolling To: Richard Biener Cc: GCC Patches , Segher Boessenkool , Bill Schmidt , "bin.cheng" , Richard Sandiford References: From: "Kewen.Lin" Message-ID: <14a1583a-d1b7-6ecf-4a44-6da7be7fd049@linux.ibm.com> Date: Wed, 3 Jun 2020 11:46:30 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 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.216, 18.0.687 definitions=2020-06-02_15:2020-06-02, 2020-06-02 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 mlxlogscore=999 cotscore=-2147483648 mlxscore=0 adultscore=0 spamscore=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006030023 X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_SHORT, 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, 03 Jun 2020 03:46:42 -0000 Hi Richi, on 2020/6/2 下午7:38, Richard Biener wrote: > On Thu, 28 May 2020, Kewen.Lin wrote: > >> Hi, >> >> This is one repost and you can refer to the original series >> via https://gcc.gnu.org/pipermail/gcc-patches/2020-January/538360.html. >> >> As we discussed in the thread >> https://gcc.gnu.org/ml/gcc-patches/2020-01/msg00196.html >> Original: https://gcc.gnu.org/ml/gcc-patches/2020-01/msg00104.html, >> I'm working to teach IVOPTs to consider D-form group access during unrolling. >> The difference on D-form and other forms during unrolling is we can put the >> stride into displacement field to avoid additional step increment. eg: >> >> With X-form (uf step increment): >> ... >> LD A = baseA, X >> LD B = baseB, X >> ST C = baseC, X >> X = X + stride >> LD A = baseA, X >> LD B = baseB, X >> ST C = baseC, X >> X = X + stride >> LD A = baseA, X >> LD B = baseB, X >> ST C = baseC, X >> X = X + stride >> ... >> >> With D-form (one step increment for each base): >> ... >> LD A = baseA, OFF >> LD B = baseB, OFF >> ST C = baseC, OFF >> LD A = baseA, OFF+stride >> LD B = baseB, OFF+stride >> ST C = baseC, OFF+stride >> LD A = baseA, OFF+2*stride >> LD B = baseB, OFF+2*stride >> ST C = baseC, OFF+2*stride >> ... >> baseA += stride * uf >> baseB += stride * uf >> baseC += stride * uf >> >> Imagining that if the loop get unrolled by 8 times, then 3 step updates with >> D-form vs. 8 step updates with X-form. Here we only need to check stride >> meet D-form field requirement, since if OFF doesn't meet, we can construct >> baseA' with baseA + OFF. > > I'd just mention there are other targets that have the choice between > the above forms. Since IVOPTs itself does not perform the unrolling > the IL it produces is the same, correct? > Yes. Before this patch, IVOPTs doesn't consider the unrolling impacts, it only models things based on what it sees. We can assume it thinks later RTL unrolling won't perform. With this patch, since the IV choice probably changes, the IL can probably change. The typical difference with this patch is: vect__1.7_15 = MEM[symbol: x, index: ivtmp.19_22, offset: 0B]; vs. vect__1.7_15 = MEM[base: _29, offset: 0B]; BR, Kewen > Richard. >