From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 103302 invoked by alias); 14 Sep 2019 09:35:09 -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 103294 invoked by uid 89); 14 Sep 2019 09:35:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy=H*i:sk:nycvar., H*UA:Intel, H*u:Intel, segher 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; Sat, 14 Sep 2019 09:35:08 +0000 Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x8E9VgNQ196011 for ; Sat, 14 Sep 2019 05:35:06 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2v0uur26wp-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 14 Sep 2019 05:35:05 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 14 Sep 2019 10:35:03 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) 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) Sat, 14 Sep 2019 10:35:02 +0100 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x8E9Z1mA52297956 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 14 Sep 2019 09:35:01 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 374A14203F; Sat, 14 Sep 2019 09:35:01 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 947CB42042; Sat, 14 Sep 2019 09:34:58 +0000 (GMT) Received: from KewenLins-MacBook-Pro.local (unknown [9.197.232.62]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Sat, 14 Sep 2019 09:34:58 +0000 (GMT) Subject: Re: [PATCH v6 3/3] PR80791 Consider doloop cmp use in ivopts To: Richard Biener Cc: gcc-patches List , Segher Boessenkool , "Bin.Cheng" , Bill Schmidt References: <9d622cb7-2c1f-91bf-a61e-0239aa2ea8bf@linux.ibm.com> <6d0b4b11-1c33-fbd5-604d-293c01b1c285@linux.ibm.com> <43a3b3c1-9c41-82fa-a5db-1a7a1a5ceae1@linux.ibm.com> <20190823101847.GM31406@gate.crashing.org> <4dee3bbc-8b1b-2aba-4e24-0293236d1203@linux.ibm.com> From: "Kewen.Lin" Date: Sat, 14 Sep 2019 09:35:00 -0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit x-cbid: 19091409-0012-0000-0000-0000034B3FFA X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19091409-0013-0000-0000-00002185B1EE Message-Id: X-IsSubscribed: yes X-SW-Source: 2019-09/txt/msg00893.txt.bz2 on 2019/9/12 下午4:14, Richard Biener wrote: > On Wed, 11 Sep 2019, Kewen.Lin wrote: > >> Hi, >> >> Sorry for the late update. I've updated the words of target hooks part. >> >> Could someone help to review it? Thanks in advance! >> >> By the way, as previous emails in this thread, Bin has approved the IVOPTs >> part, while Segher has approved the rs6000 part. > > The target hooks part is OK. I guess we'll have to extend it eventually > in case other targets want to make use of it. > Thanks Richard! Committed by r275713. Yes, it's enough when doloop IV costs zero or infinite for generic/address use, but if one target wants some other values, we may have to take it as one common cost shared for all generic/address uses. It's like IV candidate cost but not the same since it's only needed when doloop IV is used for generic/address uses, I guess it requires some changes in candidate set cost calculation. I chose to keep it simple at the first place, but radar on for any other target adoptions. Thanks, Kewen > Thanks, > Richard. > >> >> Thanks, >> Kewen >> >> ----- >> >> gcc/ChangeLog >> >> 2019-09-11 Kewen Lin >> >> PR middle-end/80791 >> * config/rs6000/rs6000.c (TARGET_HAVE_COUNT_REG_DECR_P): New macro. >> (TARGET_DOLOOP_COST_FOR_GENERIC): Likewise. >> (TARGET_DOLOOP_COST_FOR_ADDRESS): Likewise. >> * target.def (have_count_reg_decr_p): New hook. >> (doloop_cost_for_generic): Likewise. >> (doloop_cost_for_address): Likewise. >> * doc/tm.texi.in (TARGET_HAVE_COUNT_REG_DECR_P): Likewise. >> (TARGET_DOLOOP_COST_FOR_GENERIC): Likewise. >> (TARGET_DOLOOP_COST_FOR_ADDRESS): Likewise. >> * doc/tm.texi: Regenerate. >> * tree-ssa-loop-ivopts.c (comp_cost::operator+=): Consider infinite cost >> addend. >> (record_group): Init doloop_p. >> (add_candidate_1): Add optional argument doloop, change the handlings >> accordingly. >> (add_candidate): Likewise. >> (generic_predict_doloop_p): Update attribute. >> (force_expr_to_var_cost): Add costing for expressions COND_EXPR/LT_EXPR/ >> LE_EXPR/GT_EXPR/GE_EXPR/EQ_EXPR/NE_EXPR/UNORDERED_EXPR/ORDERED_EXPR/ >> UNLT_EXPR/UNLE_EXPR/UNGT_EXPR/UNGE_EXPR/UNEQ_EXPR/LTGT_EXPR/MAX_EXPR/ >> MIN_EXPR. >> (get_computation_cost): Update for doloop IV cand extra cost. >> (determine_group_iv_cost_cond): Update for doloop IV cand. >> (determine_iv_cost): Likewise. >> (ivopts_estimate_reg_pressure): Likewise. >> (may_eliminate_iv): Update handlings for doloop IV cand. >> (add_iv_candidate_for_doloop): New function. >> (find_iv_candidates): Call function add_iv_candidate_for_doloop. >> (iv_ca_set_no_cp): Update for doloop IV cand. >> (iv_ca_set_cp): Likewise. >> (iv_ca_dump): Dump register cost. >> (find_doloop_use): New function. >> (analyze_and_mark_doloop_use): Likewise. >> (tree_ssa_iv_optimize_loop): Call function analyze_and_mark_doloop_use. >> >> gcc/testsuite/ChangeLog >> >> 2019-09-11 Kewen Lin >> >> PR middle-end/80791 >> * gcc.dg/tree-ssa/ivopts-3.c: Adjust for doloop change. >> * gcc.dg/tree-ssa/ivopts-lt.c: Likewise. >> * gcc.dg/tree-ssa/pr32044.c: Likewise. >> >> >> on 2019/8/23 下午6:18, Segher Boessenkool wrote: >>> Hi! >>> >>> On Fri, Aug 23, 2019 at 05:43:32PM +0800, Bin.Cheng wrote: >>>> On Fri, Aug 23, 2019 at 4:27 PM Kewen.Lin wrote: >>>> Not sure if non-ivopts parts are already approved? If so, the patch >>>> is okay with above issues addressed. >>> >>> The rs6000 part is fine. The target.def entries need some spell check >>> and copy-editing, but are obvious and trivial otherwise, and/or you can >>> approve it as ivopts maintainer. >>> >>>> Thanks very much for your time! >>> >>> And thank you as well Bin :-) >>> >>> >>> Segher >>> >> >