diff options
Diffstat (limited to 'gcc/cgraph.h')
-rw-r--r-- | gcc/cgraph.h | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 84824e9f814..1c952eb5094 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -942,7 +942,7 @@ public: All hooks will see this in node's global.inlined_to, when invoked. Can be NULL if the node is not inlined. SUFFIX is string that is appended to the original name. */ - cgraph_node *create_clone (tree decl, profile_count count, int freq, + cgraph_node *create_clone (tree decl, profile_count count, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, @@ -1110,14 +1110,13 @@ public: /* Create edge from a given function to CALLEE in the cgraph. */ cgraph_edge *create_edge (cgraph_node *callee, - gcall *call_stmt, profile_count count, - int freq); + gcall *call_stmt, profile_count count); /* Create an indirect edge with a yet-undetermined callee where the call statement destination is a formal parameter of the caller with index PARAM_INDEX. */ cgraph_edge *create_indirect_edge (gcall *call_stmt, int ecf_flags, - profile_count count, int freq, + profile_count count, bool compute_indirect_info = true); /* Like cgraph_create_edge walk the clone tree and update all clones sharing @@ -1126,7 +1125,6 @@ public: void create_edge_including_clones (cgraph_node *callee, gimple *old_stmt, gcall *stmt, profile_count count, - int freq, cgraph_inline_failed_t reason); /* Return the callgraph edge representing the GIMPLE_CALL statement @@ -1665,8 +1663,7 @@ struct GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_caller"), /* Turn edge into speculative call calling N2. Update the profile so the direct call is taken COUNT times with FREQUENCY. */ - cgraph_edge *make_speculative (cgraph_node *n2, profile_count direct_count, - int direct_frequency); + cgraph_edge *make_speculative (cgraph_node *n2, profile_count direct_count); /* Given speculative call edge, return all three components. */ void speculative_call_info (cgraph_edge *&direct, cgraph_edge *&indirect, @@ -1684,11 +1681,11 @@ struct GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_caller"), /* Create clone of edge in the node N represented by CALL_EXPR the callgraph. */ cgraph_edge * clone (cgraph_node *n, gcall *call_stmt, unsigned stmt_uid, - profile_count num, profile_count den, int freq_scale, + profile_count num, profile_count den, bool update_original); /* Verify edge count and frequency. */ - bool verify_count_and_frequency (); + bool verify_count (); /* Return true when call of edge can not lead to return from caller and thus it is safe to ignore its side effects for IPA analysis @@ -1728,10 +1725,6 @@ struct GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_caller"), /* The stmt_uid of call_stmt. This is used by LTO to recover the call_stmt when the function is serialized in. */ unsigned int lto_stmt_uid; - /* Expected frequency of executions within the function. - When set to CGRAPH_FREQ_BASE, the edge is expected to be called once - per function call. The range is 0 to CGRAPH_FREQ_MAX. */ - int frequency; /* Unique id of the edge. */ int uid; /* Whether this edge was made direct by indirect inlining. */ @@ -1769,6 +1762,13 @@ struct GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_caller"), /* Return true if call must bind to current definition. */ bool binds_to_current_def_p (); + /* Expected frequency of executions within the function. + When set to CGRAPH_FREQ_BASE, the edge is expected to be called once + per function call. The range is 0 to CGRAPH_FREQ_MAX. */ + int frequency (); + + /* Expected frequency of executions within the function. */ + sreal sreal_frequency (); private: /* Remove the edge from the list of the callers of the callee. */ void remove_caller (void); @@ -2287,7 +2287,7 @@ private: parameters of which only CALLEE can be NULL (when creating an indirect call edge). */ cgraph_edge *create_edge (cgraph_node *caller, cgraph_node *callee, - gcall *call_stmt, profile_count count, int freq, + gcall *call_stmt, profile_count count, bool indir_unknown_callee); /* Put the edge onto the free list. */ @@ -3111,6 +3111,19 @@ cgraph_edge::binds_to_current_def_p () return false; } +/* Expected frequency of executions within the function. + When set to CGRAPH_FREQ_BASE, the edge is expected to be called once + per function call. The range is 0 to CGRAPH_FREQ_MAX. */ + +inline int +cgraph_edge::frequency () +{ + return count.to_cgraph_frequency (caller->global.inlined_to + ? caller->global.inlined_to->count + : caller->count); +} + + /* Return true if the TM_CLONE bit is set for a given FNDECL. */ static inline bool decl_is_tm_clone (const_tree fndecl) |