From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 45843 invoked by alias); 14 Jun 2019 23:46:57 -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 45835 invoked by uid 89); 14 Jun 2019 23:46:56 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy=Everything, H*M:e941 X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 14 Jun 2019 23:46:55 +0000 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5ENfteq078894; Fri, 14 Jun 2019 19:46:54 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2t4m7has7f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 14 Jun 2019 19:46:53 -0400 Received: from m0098396.ppops.net (m0098396.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id x5ENkrPa086575; Fri, 14 Jun 2019 19:46:53 -0400 Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com with ESMTP id 2t4m7has74-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 14 Jun 2019 19:46:53 -0400 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x5EMi9Ca003901; Fri, 14 Jun 2019 22:46:36 GMT Received: from b01cxnp22033.gho.pok.ibm.com (b01cxnp22033.gho.pok.ibm.com [9.57.198.23]) by ppma01dal.us.ibm.com with ESMTP id 2t1x6t7mnu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 14 Jun 2019 22:46:36 +0000 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x5ENkpPS26739018 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 Jun 2019 23:46:51 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7D895AE05F; Fri, 14 Jun 2019 23:46:51 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D7621AE05C; Fri, 14 Jun 2019 23:46:50 +0000 (GMT) Received: from BigMac.local (unknown [9.85.175.155]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 14 Jun 2019 23:46:50 +0000 (GMT) Subject: Re: [PATCH v4 2/3] Add predict_doloop_p target hook To: Segher Boessenkool , "Kewen.Lin" Cc: gcc-patches@gcc.gnu.org, Richard Biener , Jeff Law , bin.cheng@linux.alibaba.com, jakub@redhat.com, Kugan Vivekanandarajah References: <1558064130-111037-1-git-send-email-linkw@linux.ibm.com> <20190520102439.GT31586@gate.crashing.org> <20190520163759.GY31586@gate.crashing.org> <3d3347ad-6910-a5ea-11f9-1a4fc3cbc6d0@linux.ibm.com> <20190614215352.GU31586@gate.crashing.org> From: Bill Schmidt Message-ID: <97ea6425-e941-8fa2-c887-bd81d2948077@linux.ibm.com> Date: Fri, 14 Jun 2019 23:46:00 -0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190614215352.GU31586@gate.crashing.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-06/txt/msg00868.txt.bz2 On 6/14/19 4:53 PM, Segher Boessenkool wrote: > Hi Kewen, > > On Thu, Jun 13, 2019 at 01:50:05PM +0800, Kewen.Lin wrote: >> Comparing with the previous version, I dropped the checks >> on costly niter and invalid stmt scanning. As Richard's >> suggestion, keep this as simple as possible, refine it >> if finding any cases which matter later. > I think we'll want the invalid statement thing back pretty soon, it just > happens too often (20% of the time), and it makes ivopts make bad decisions. > It does not matter (much) for the performance of the generated code, but > still :-) > >> +/* Predict whether the given loop in gimple will be transformed in the RTL >> + doloop_optimize pass. This is for rs6000 target specific. */ > Everything in rs6000/ is target-specific ;-) Remove that part? > >> + /* On rs6000, targetm.can_use_doloop_p is actually >> + can_use_doloop_if_innermost. Just ensure it's innermost. */ > "the loop is innermost". > >> + fprintf (dump_file, "Predict doloop failure due to" >> + " no innermost.\n"); > "due to no innermost" isn't great, but I don't know how th phrase it > better, either :-/ It's just debug output of course, so not so very > important. How about "due to loop nesting?" Bill > >> +This target hook is required only when the target supports low-overhead >> +loops, and will help some earlier middle-end passes to make some decisions. > Maybe just say it is for ivopts? Or say that targets that do support > low-overhead loops *should* implement it? > >> +/* True if we can predict this loop is possible to be transformed to a >> + low-overhead loop, otherwise returns false. > "Return true if we predict the loop LOOP will be transformed to a > low-overhead loop, otherwise return false"? Or mention doloop_optimize > like below: > >> +/* Predict whether the given loop will be transformed in the RTL >> + doloop_optimize pass. Attempt to duplicate some doloop_optimize checks. >> + This is only for target independent checks, see targetm.predict_doloop_p >> + for the target dependent ones. >> + >> + Note that according to some initial investigation, some checks like costly >> + niter check and invalid stmt scanning don't have much gains among general >> + cases, so keep this as simple as possible first. >> + >> + Some RTL specific checks seems unable to be checked in gimple, if any new >> + checks or easy checks _are_ missing here, please add them. */ > Good useful note, thanks :-) > > The rs6000 part is okay for trunk. Thanks! > > > Segher >