From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 76115 invoked by alias); 20 Jun 2019 09:09:05 -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 76027 invoked by uid 89); 20 Jun 2019 09:09:04 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy= X-HELO: gate.crashing.org Received: from gate.crashing.org (HELO gate.crashing.org) (63.228.1.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 20 Jun 2019 09:09:03 +0000 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id x5K990BN012227; Thu, 20 Jun 2019 04:09:00 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id x5K98x9q012226; Thu, 20 Jun 2019 04:08:59 -0500 Date: Thu, 20 Jun 2019 09:09:00 -0000 From: Segher Boessenkool To: "Kewen.Lin" Cc: gcc-patches@gcc.gnu.org, wschmidt@linux.ibm.com, bin.cheng@linux.alibaba.com, rguenther@suse.de, jakub@redhat.com, Jeff Law , Kugan Vivekanandarajah Subject: Re: [PATCH v3 3/3] PR80791 Consider doloop cmp use in ivopts Message-ID: <20190620090859.GU7313@gate.crashing.org> References: <1557803406-123657-1-git-send-email-linkw@linux.ibm.com> <2d897dc2-a01c-5005-6973-aad0c5930aa8@linux.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2d897dc2-a01c-5005-6973-aad0c5930aa8@linux.ibm.com> User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2019-06/txt/msg01204.txt.bz2 Hi Kewen, On Wed, Jun 19, 2019 at 07:47:34PM +0800, Kewen.Lin wrote: > +/* Return true if count register for branch is supported. */ > + > +static bool > +rs6000_have_count_reg_decr_p () > +{ > + return flag_branch_on_count_reg; > +} rs6000 unconditionally supports these instructions, not just when that flag is set. If you need to look at the flag, the *caller* of this new hook should, not every implementation of the hook. So just "return true" here? > DEFHOOK > +(have_count_reg_decr_p, > + "Return true if the target supports hardware count register for decrement\n\ > +and branch.\n\ > +The default version of this hook returns false.", > + bool, (void), > + hook_bool_void_false) Is it important here that you cannot use that register as a GPR, that any use of it is expensive because it has to be moved to/from a GPR? The doc should say something like that; a little more context, what the hook is meant to be used for. > +/* For doloop use, if the algothrim selects some candidate which invalid for > + later rewrite, fix it up with bind_cand. */ "algorithm", "which is invalid". > +/* Find doloop comparison use and set its related bind_cand. We adjust the > + doloop use group cost against various IV cands, it's possible to assign > + some cost like zero rather than original inifite cost. The point is to "infinite" Looks good :-) Segher