From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 120942 invoked by alias); 9 Aug 2017 15:56:36 -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 120862 invoked by uid 89); 9 Aug 2017 15:56:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=Hx-languages-length:1988 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 09 Aug 2017 15:56:34 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 265FA357E34; Wed, 9 Aug 2017 15:56:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 265FA357E34 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=law@redhat.com Received: from localhost.localdomain (ovpn-116-95.phx2.redhat.com [10.3.116.95]) by smtp.corp.redhat.com (Postfix) with ESMTP id C60A3845C7; Wed, 9 Aug 2017 15:56:31 +0000 (UTC) Subject: Re: [PATCH 0/5] RFC, WIP: RTL cost improvements To: Segher Boessenkool , gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org References: <87zibegwfb.fsf@linaro.org> <20170805171546.GC13471@gate.crashing.org> <3f10fa05-87ae-2580-819b-27cf69c4c6e9@redhat.com> <871som9ezk.fsf@linaro.org> From: Jeff Law Message-ID: <3a609f36-d07b-1e75-259b-dba687ff9302@redhat.com> Date: Wed, 09 Aug 2017 15:56:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <871som9ezk.fsf@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2017-08/txt/msg00674.txt.bz2 On 08/08/2017 10:54 AM, Richard Sandiford wrote: >>> For speed cost I primarily use "type", modified by the number of machine >>> insns a pattern generates (quite a few are split); and I get the number >>> of machine insns just from "length" again, which for rs6000 is easy and >>> correct in most cases. Some other targets may need something else. >> >>> >>> I also have an attribute "cost" that can be used to override the >>> default calculation; that seems useful to standardise on. I've pondered >>> a "cost_adjust" that will be added to the calculated cost instead, but >>> it hasn't been useful so far. >> Let's go ahead and "reserve" cost and cost_adjust for this purpose. If >> we find that cost_adjust isn't actually necessary, then so be it, it's >> not a big deal to me. > > I was thinking we should have separate attributes for size and speed > from the outset. How about size_cost and speed_cost? It'd be up > to the target to decide whether to define them as the sums of various > sub-attributes (like it's the target's decision how to break "enabled" > down). But size_cost should be equivalent to the already standardized length attribute. So I'm struggling to see a need for that. Again, no strong opinions on how to structure the speed cost other than to standardize a name. > > The advantage of doing it all in attributes is that the generator might > be able to help optimise the process of checking for costs. No promises > though :-) :-) > > TBH I think we should start with the attributes as well-defined names > and only add the hook if we find we still need it. I can't really see > what a C function would give over keeping the costs with the instruction > definitions. I'd think the C function would mostly be helpful on a cisc target where operands are potentially complex. But I don't feel strongly enough about it to argue -- I'm happy to go with consensus and fault in adjustments if we need them. jeff