From patchwork Fri Dec 6 14:51:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Malcolm X-Patchwork-Id: 298050 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A5DAA2C0090 for ; Sat, 7 Dec 2013 01:54:23 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=EjLgLW9o8V+zRBfpRTkNTWbqhqhQ1dVczF40fZLuKXY7igwTm52nm oHXYWryk1nvHAWPyQqULpndxKZk3HximUXjrQpwU+Q3BxR+RGtE2d7cwzEB0PHAA /X33FXzAVKXTG3ZWhWAZOG0epsYyOHSMza0EZWk9Qjb9Dvj/OknB+w= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; s= default; bh=0x1HXmR916zovG4dD1ed/KpTDJM=; b=xjx7h0LyBrJuFnvLwkEV oJJgnUhs5aPgvqegB17eX62qjeyifuerxeUzfggOK33MRF5tEjfWU5Boo5UWfrcK aCPacHRhPs/Od+pyTmRC/a6kCPMBbwT79PzPkDI2hhAlPcVgiVziSt+OENIY5Sib TP0kwqRq6NoqJb+OSTe4deA= Received: (qmail 21142 invoked by alias); 6 Dec 2013 14:53:05 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 21004 invoked by uid 89); 6 Dec 2013 14:53:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: eggs.gnu.org Received: from Unknown (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 06 Dec 2013 14:53:02 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vowlp-0005vE-BJ for gcc-patches@gcc.gnu.org; Fri, 06 Dec 2013 09:52:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39317) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vowlp-0005ut-3O for gcc-patches@gcc.gnu.org; Fri, 06 Dec 2013 09:52:45 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rB6EqhCM022303 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 6 Dec 2013 09:52:43 -0500 Received: from surprise.redhat.com (vpn-229-183.phx2.redhat.com [10.3.229.183]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rB6Eqd3X029860; Fri, 6 Dec 2013 09:52:42 -0500 From: David Malcolm To: Richard Biener Cc: gcc-patches@gcc.gnu.org, David Malcolm Subject: [PATCH 04/13] Rename profile_status_for_function to profile_status_for_fn. Date: Fri, 6 Dec 2013 09:51:30 -0500 Message-Id: <1386341499-19603-5-git-send-email-dmalcolm@redhat.com> In-Reply-To: <1386341499-19603-1-git-send-email-dmalcolm@redhat.com> References: <1384898628.11568.127.camel@surprise> <1386341499-19603-1-git-send-email-dmalcolm@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 X-IsSubscribed: yes gcc/ * basic-block.h (profile_status_for_function): Rename to... (profile_status_for_fn): ...this. * cfg.c (check_bb_profile): Update for renaming. * cgraphbuild.c (compute_call_stmt_bb_frequency): Likewise. * lto-streamer-in.c (input_cfg): Likewise. * lto-streamer-out.c (output_cfg): Likewise. * predict.c (maybe_hot_frequency_p, maybe_hot_count_p, maybe_hot_bb_p, probably_never_executed) (handle_missing_profiles): Likewise. * tree-cfg.c (init_empty_tree_cfg_for_function): Likewise. * tree-inline.c (copy_bb, initialize_cfun): Likewise. --- gcc/basic-block.h | 2 +- gcc/cfg.c | 2 +- gcc/cgraphbuild.c | 2 +- gcc/lto-streamer-in.c | 4 ++-- gcc/lto-streamer-out.c | 2 +- gcc/predict.c | 12 ++++++------ gcc/tree-cfg.c | 2 +- gcc/tree-inline.c | 4 ++-- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/gcc/basic-block.h b/gcc/basic-block.h index 1471972..da93c6f 100644 --- a/gcc/basic-block.h +++ b/gcc/basic-block.h @@ -319,7 +319,7 @@ struct GTY(()) control_flow_graph { #define n_edges_for_fn(FN) ((FN)->cfg->x_n_edges) #define last_basic_block_for_fn(FN) ((FN)->cfg->x_last_basic_block) #define label_to_block_map_for_fn(FN) ((FN)->cfg->x_label_to_block_map) -#define profile_status_for_function(FN) ((FN)->cfg->x_profile_status) +#define profile_status_for_fn(FN) ((FN)->cfg->x_profile_status) #define BASIC_BLOCK_FOR_FN(FN,N) \ ((*basic_block_info_for_fn (FN))[(N)]) diff --git a/gcc/cfg.c b/gcc/cfg.c index 6bceca5..786fe48 100644 --- a/gcc/cfg.c +++ b/gcc/cfg.c @@ -408,7 +408,7 @@ check_bb_profile (basic_block bb, FILE * file, int indent, int flags) memset ((void *) s_indent, ' ', (size_t) indent); s_indent[indent] = '\0'; - if (profile_status_for_function (fun) == PROFILE_ABSENT) + if (profile_status_for_fn (fun) == PROFILE_ABSENT) return; if (bb != EXIT_BLOCK_PTR_FOR_FN (fun)) diff --git a/gcc/cgraphbuild.c b/gcc/cgraphbuild.c index 9a63982..6c6698b 100644 --- a/gcc/cgraphbuild.c +++ b/gcc/cgraphbuild.c @@ -208,7 +208,7 @@ compute_call_stmt_bb_frequency (tree decl, basic_block bb) (DECL_STRUCT_FUNCTION (decl))->frequency; int freq = bb->frequency; - if (profile_status_for_function (DECL_STRUCT_FUNCTION (decl)) == PROFILE_ABSENT) + if (profile_status_for_fn (DECL_STRUCT_FUNCTION (decl)) == PROFILE_ABSENT) return CGRAPH_FREQ_BASE; if (!entry_freq) diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c index 91fb12d..8dc94bd 100644 --- a/gcc/lto-streamer-in.c +++ b/gcc/lto-streamer-in.c @@ -632,8 +632,8 @@ input_cfg (struct lto_input_block *ib, struct data_in *data_in, init_empty_tree_cfg_for_function (fn); init_ssa_operands (fn); - profile_status_for_function (fn) = streamer_read_enum (ib, profile_status_d, - PROFILE_LAST); + profile_status_for_fn (fn) = streamer_read_enum (ib, profile_status_d, + PROFILE_LAST); bb_count = streamer_read_uhwi (ib); diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c index 858d49e..615cc84 100644 --- a/gcc/lto-streamer-out.c +++ b/gcc/lto-streamer-out.c @@ -1630,7 +1630,7 @@ output_cfg (struct output_block *ob, struct function *fn) ob->main_stream = ob->cfg_stream; streamer_write_enum (ob->main_stream, profile_status_d, PROFILE_LAST, - profile_status_for_function (fn)); + profile_status_for_fn (fn)); /* Output the number of the highest basic block. */ streamer_write_uhwi (ob, last_basic_block_for_fn (fn)); diff --git a/gcc/predict.c b/gcc/predict.c index 1cd3fa6..e959a3b 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -121,7 +121,7 @@ maybe_hot_frequency_p (struct function *fun, int freq) if (node->frequency == NODE_FREQUENCY_HOT) return true; } - if (profile_status_for_function (fun) == PROFILE_ABSENT) + if (profile_status_for_fn (fun) == PROFILE_ABSENT) return true; if (node->frequency == NODE_FREQUENCY_EXECUTED_ONCE && freq < (ENTRY_BLOCK_PTR_FOR_FN (fun)->frequency * 2 / 3)) @@ -164,7 +164,7 @@ set_hot_bb_threshold (gcov_type min) static inline bool maybe_hot_count_p (struct function *fun, gcov_type count) { - if (fun && profile_status_for_function (fun) != PROFILE_READ) + if (fun && profile_status_for_fn (fun) != PROFILE_READ) return true; /* Code executed at most once is not hot. */ if (profile_info->runs >= count) @@ -179,7 +179,7 @@ bool maybe_hot_bb_p (struct function *fun, const_basic_block bb) { gcc_checking_assert (fun); - if (profile_status_for_function (fun) == PROFILE_READ) + if (profile_status_for_fn (fun) == PROFILE_READ) return maybe_hot_count_p (fun, bb->count); return maybe_hot_frequency_p (fun, bb->frequency); } @@ -239,7 +239,7 @@ probably_never_executed (struct function *fun, gcov_type count, int frequency) { gcc_checking_assert (fun); - if (profile_status_for_function (fun) == PROFILE_READ) + if (profile_status_for_fn (fun) == PROFILE_READ) { int unlikely_count_fraction = PARAM_VALUE (UNLIKELY_BB_COUNT_FRACTION); if (count * unlikely_count_fraction >= profile_info->runs) @@ -2806,7 +2806,7 @@ drop_profile (struct cgraph_node *node, gcov_type call_count) node->name (), node->order); } - profile_status_for_function (fn) + profile_status_for_fn (fn) = (flag_guess_branch_prob ? PROFILE_GUESSED : PROFILE_ABSENT); node->frequency = hot ? NODE_FREQUENCY_HOT : NODE_FREQUENCY_NORMAL; @@ -2869,7 +2869,7 @@ handle_missing_profiles (void) if (callee->count > 0) continue; if (DECL_COMDAT (callee->decl) && fn && fn->cfg - && profile_status_for_function (fn) == PROFILE_READ) + && profile_status_for_fn (fn) == PROFILE_READ) { drop_profile (node, 0); worklist.safe_push (callee); diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 998ee26..6c2cc16 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -182,7 +182,7 @@ init_empty_tree_cfg_for_function (struct function *fn) { /* Initialize the basic block array. */ init_flow (fn); - profile_status_for_function (fn) = PROFILE_ABSENT; + profile_status_for_fn (fn) = PROFILE_ABSENT; n_basic_blocks_for_fn (fn) = NUM_FIXED_BLOCKS; last_basic_block_for_fn (fn) = NUM_FIXED_BLOCKS; vec_alloc (basic_block_info_for_fn (fn), initial_cfg_capacity); diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index f42ade02..abc216d 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -1792,7 +1792,7 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale, { edge->frequency = new_freq; if (dump_file - && profile_status_for_function (cfun) != PROFILE_ABSENT + && profile_status_for_fn (cfun) != PROFILE_ABSENT && (edge_freq > edge->frequency + 10 || edge_freq < edge->frequency - 10)) { @@ -2208,7 +2208,7 @@ initialize_cfun (tree new_fndecl, tree callee_fndecl, gcov_type count) init_empty_tree_cfg (); - profile_status_for_function (cfun) = profile_status_for_function (src_cfun); + profile_status_for_fn (cfun) = profile_status_for_fn (src_cfun); ENTRY_BLOCK_PTR_FOR_FN (cfun)->count = (ENTRY_BLOCK_PTR_FOR_FN (src_cfun)->count * count_scale / REG_BR_PROB_BASE);