diff options
author | Jan Hubicka <jh@suse.cz> | 2011-04-19 14:23:38 +0000 |
---|---|---|
committer | Jan Hubicka <jh@suse.cz> | 2011-04-19 14:23:38 +0000 |
commit | 523c793840869d1b7c0581781fea0abd46d1c12f (patch) | |
tree | e7abfb685c06837c0897e65f060f8fea73d402cb /gcc/predict.c | |
parent | f2e09ea91c3d4eaf3ddef058fbb50c12eeefe9be (diff) |
* cgraph.h (cgraph_optimize_for_size_p): Declare.
* ipa-cp.c (ipcp_insert_stage): Use cgraph_optimize_for_size_p.
* predict.c (cgraph_optimize_for_size_p): Break out from ...
(optimize_function_for_size_p) ... here.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@172711 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/predict.c')
-rw-r--r-- | gcc/predict.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/gcc/predict.c b/gcc/predict.c index f210428fca1..db9c5c5a8fe 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -196,7 +196,9 @@ maybe_hot_edge_p (edge e) return maybe_hot_frequency_p (EDGE_FREQUENCY (e)); } + /* Return true in case BB is probably never executed. */ + bool probably_never_executed_bb_p (const_basic_block bb) { @@ -209,24 +211,31 @@ probably_never_executed_bb_p (const_basic_block bb) return false; } -/* Return true when current function should always be optimized for size. */ +/* Return true if NODE should be optimized for size. */ bool -optimize_function_for_size_p (struct function *fun) +cgraph_optimize_for_size_p (struct cgraph_node *node) { - struct cgraph_node *node; - if (optimize_size) return true; - if (!fun || !fun->decl) - return false; - node = cgraph_get_node (fun->decl); if (node && (node->frequency == NODE_FREQUENCY_UNLIKELY_EXECUTED)) return true; else return false; } +/* Return true when current function should always be optimized for size. */ + +bool +optimize_function_for_size_p (struct function *fun) +{ + if (optimize_size) + return true; + if (!fun || !fun->decl) + return false; + return cgraph_optimize_for_size_p (cgraph_get_node (fun->decl)); +} + /* Return true when current function should always be optimized for speed. */ bool |