From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23571 invoked by alias); 15 Jul 2019 10:39:41 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 23285 invoked by uid 89); 15 Jul 2019 10:39:40 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.0 required=5.0 tests=AWL,BAYES_00,MIME_CHARSET_FARAWAY,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy= 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; Mon, 15 Jul 2019 10:39:39 +0000 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x6FAb40u066666 for ; Mon, 15 Jul 2019 06:39:37 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 2trp54mys5-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 15 Jul 2019 06:39:36 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 15 Jul 2019 11:39:35 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 15 Jul 2019 11:39:33 +0100 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x6FAdWo558458174 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 15 Jul 2019 10:39:32 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 53CC842042; Mon, 15 Jul 2019 10:39:32 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D4B9D4203F; Mon, 15 Jul 2019 10:39:25 +0000 (GMT) Received: from 192.168.10.100 (unknown [9.197.248.170]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 15 Jul 2019 10:39:24 +0000 (GMT) Subject: Re: Check rrotate optab first when transforming lrotate To: Jakub Jelinek Cc: GCC Patches , Richard Biener , richard.sandiford@arm.com, Segher Boessenkool , Bill Schmidt References: <232a38b1-76c2-476d-1be0-a1958e5624bb@linux.ibm.com> <20190715085929.GO2125@tucnak> From: "Kewen.Lin" Date: Mon, 15 Jul 2019 10:54:00 -0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190715085929.GO2125@tucnak> Content-Type: text/plain; charset=gbk Content-Transfer-Encoding: 8bit x-cbid: 19071510-0012-0000-0000-00000332B898 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19071510-0013-0000-0000-0000216C2DFB Message-Id: <26483787-de9e-85bb-7b66-a56a187c6575@linux.ibm.com> X-IsSubscribed: yes X-SW-Source: 2019-07/txt/msg01055.txt.bz2 Hi Jakub, on 2019/7/15 ÏÂÎç4:59, Jakub Jelinek wrote: > On Mon, Jul 15, 2019 at 04:50:13PM +0800, Kewen.Lin wrote: >> In match.pd and expmed.c, we have some codes to transform lrotate to >> rrotate if rotation count is const. But they don't consider the target >> whether supports the rrotate. It leads to some suboptimal generated >> code since some optimization can't get expected result by querying >> target optab. One typical case is that we miss some rotation >> vectorization opportunity on Power. > > This will not do the right thing if neither lrotate nor rrotate is > supported, you want to canonicalize in that case IMHO. > The code formatting is wrong (|| at the end of line, overly long lines). > > Finally, what is the reason why Power doesn't support one of the rotates? > Especially for rotates by constant, you can transform those in the > define_expand. > > Canonicalizing code is highly desirable during GIMPLE, it means if you have > say left rotate by 23 in one spot and right rotate by bitsize - 23 in > another spot, e.g. SCCVN can merge that code. > > So, IMNSHO, just improve the backend. > OK, I see. Thanks for the explanation. I'll try to fix it in the backend. Thanks, Kewen