From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28343 invoked by alias); 13 Jul 2016 21:18: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 28327 invoked by uid 89); 13 Jul 2016 21:18:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=UD:ifcvt.c, ifcvt.c, ifcvtc, Hx-languages-length:1573 X-Spam-User: qpsmtpd, 2 recipients 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 13 Jul 2016 21:18:26 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EBD3D55389; Wed, 13 Jul 2016 21:18:24 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-70.phx2.redhat.com [10.3.116.70]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6DLIOl4020725; Wed, 13 Jul 2016 17:18:24 -0400 Subject: Re: [RFC: Patch 2/6 v2] Factor out the comparisons against magic numbers in ifcvt To: James Greenhalgh , gcc-patches@gcc.gnu.org References: <1466524231-17412-1-git-send-email-james.greenhalgh@arm.com> <1466524231-17412-2-git-send-email-james.greenhalgh@arm.com> Cc: nd@arm.com, richard.guenther@gmail.com, Ramana.Radhakrishnan@arm.com, bernds_cb1@t-online.de, ebotcazou@libertysurf.fr, steven@gcc.gnu.org From: Jeff Law Message-ID: Date: Wed, 13 Jul 2016 21:18:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <1466524231-17412-2-git-send-email-james.greenhalgh@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-07/txt/msg00763.txt.bz2 On 06/21/2016 09:50 AM, James Greenhalgh wrote: > > Hi, > > This patch pulls the comparisons between if_info->branch_cost and a magic > number representing an instruction count to a common function. While I'm > doing it, I've documented the instructions that the magic numbers relate > to, and updated them where they were inconsistent. > > If our measure of the cost of a branch is now in rtx costs units, we can > get to an estimate for the cost of an expression from the number of > instructions by multiplying through by COSTS_N_INSNS (1). > > Alternatively, we could actually construct the cheap sequences and > check the sequence. But in these cases we're expecting to if-convert on > almost all targets, the transforms in this patch are almost universally > a good idea, even for targets with a very powerful branch predictor, > eliminating the branch eliminates a basic block boundary so might be > helpful for scheduling, combine, and other RTL optimizers. > > Bootstrapped on x86-64 and aarch64 as part of the full sequence. > > OK? > > Thanks, > James > > --- > > 2016-06-21 James Greenhalgh > > * ifcvt.c (noce_if_info): New field: max_seq_cost. > (noce_estimate_conversion_profitable_p): New. > (noce_try_store_flag_constants): Use it. > (noce_try_addcc): Likewise. > (noce_try_store_flag_mask): Likewise. > (noce_try_cmove): Likewise. > (noce_try_cmove_arith): Likewise. > (noce_find_if_block): Record targetm.max_noce_ifcvt_seq_cost. > LGTM. jeff