aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.h
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2010-04-26 15:33:24 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2010-04-26 13:33:24 +0000
commit5fefcf92fa6b75486291d2a898f9a0e4d541cf6c (patch)
tree23c770f34cffee8dfe268868d96f062a649cf2fd /gcc/cgraph.h
parent21aac88050970dff5e2632aa355caed48eee894c (diff)
downloadgcc-5fefcf92fa6b75486291d2a898f9a0e4d541cf6c.zip
gcc-5fefcf92fa6b75486291d2a898f9a0e4d541cf6c.tar.gz
gcc-5fefcf92fa6b75486291d2a898f9a0e4d541cf6c.tar.bz2
cgraph.c (cgraph_create_node): Set node frequency to normal.
* cgraph.c (cgraph_create_node): Set node frequency to normal. (cgraph_clone_node): Copy function frequency. * cgraph.h (node_frequency): New enum (struct cgraph_node): Add. * final.c (rest_of_clean_state): Update. * lto-cgraph.c (lto_output_node): Output node frequency. (input_overwrite_node): Input node frequency. * tre-ssa-loop-ivopts (computation_cost): Update. * lto-streamer-out.c (output_function): Do not output function frequency. * predict.c (maybe_hot_frequency_p): Update and handle functions executed once. (cgraph_maybe_hot_edge_p): Likewise; use cgraph frequency instead of attribute lookup. (probably_never_executed_bb_p, optimize_function_for_size_p): Update. (compute_function_frequency): Set noreturn functions to be executed once. (choose_function_section): Update. * lto-streamer-in.c (input_function): Do not input function frequency. * function.c (allocate_struct_function): Do not initialize function frequency. * function.h (function_frequency): Remove. (struct function): Remove function frequency. * ipa-profile.c (CGRAPH_NODE_FREQUENCY): Remove. (try_update): Update. * tree-inline.c (initialize_cfun): Do not update function frequency. * passes.c (pass_init_dump_file): Update. * i386.c (ix86_compute_frame_layout): Update. (ix86_pad_returns): Update. From-SVN: r158732
Diffstat (limited to 'gcc/cgraph.h')
-rw-r--r--gcc/cgraph.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index 6bc565a..9b9bf4d 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -175,6 +175,21 @@ struct GTY(()) cgraph_clone_info
bitmap combined_args_to_skip;
};
+enum node_frequency {
+ /* This function most likely won't be executed at all.
+ (set only when profile feedback is available or via function attribute). */
+ NODE_FREQUENCY_UNLIKELY_EXECUTED,
+ /* For functions that are known to be executed once (i.e. constructors, destructors
+ and main function. */
+ NODE_FREQUENCY_EXECUTED_ONCE,
+ /* The default value. */
+ NODE_FREQUENCY_NORMAL,
+ /* Optimize this function hard
+ (set only when profile feedback is available or via function attribute). */
+ NODE_FREQUENCY_HOT
+};
+
+
/* The cgraph data structure.
Each function decl has assigned cgraph_node listing callees and callers. */
@@ -267,6 +282,9 @@ struct GTY((chain_next ("%h.next"), chain_prev ("%h.previous"))) cgraph_node {
/* Set for alias and thunk nodes, same_body points to the node they are alias
of and they are linked through the next/previous pointers. */
unsigned same_body_alias : 1;
+ /* How commonly executed the node is. Initialized during branch
+ probabilities pass. */
+ ENUM_BITFIELD (node_frequency) frequency : 2;
};
typedef struct cgraph_node *cgraph_node_ptr;