summaryrefslogtreecommitdiff
path: root/gcc/ipa-inline.h
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-11 18:14:35 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-11 18:14:35 +0000
commitbe343a9c2c6c0a688b3c299da498cbeb8e8ead72 (patch)
tree5c72b6d621b40aab51257d773d939ff6d2be4567 /gcc/ipa-inline.h
parentfa3448f1d003fd36bb176f4cf2d497d44287271a (diff)
downloadgcc-be343a9c2c6c0a688b3c299da498cbeb8e8ead72.tar.gz
PR middle-end/48636
* ipa-inline.c (want_inline_small_function_p): Take aray index hint. (edge_badness): Likewise. * ipa-inline.h (inline_hints_vals): Add array_index and comments. (inline_summary_: Add ARRAY_INDEX. * ipa-inline-analysis.c (dump_inline_hints): Dump array_index hint. (reset_inline_summary): Handle array_index hint. (inline_node_duplication_hook): Likewise. (dump_inline_summary): Likewise. (array_index_predicate): New function. (estimate_function_body_sizes): Use it. (estimate_node_size_and_time): Use array_index hint. (inline_merge_summary, inline_read_section): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193406 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-inline.h')
-rw-r--r--gcc/ipa-inline.h24
1 files changed, 21 insertions, 3 deletions
diff --git a/gcc/ipa-inline.h b/gcc/ipa-inline.h
index 4791bf0caab..1e9658c3b96 100644
--- a/gcc/ipa-inline.h
+++ b/gcc/ipa-inline.h
@@ -44,16 +44,32 @@ typedef struct GTY(()) condition
unsigned by_ref : 1;
} condition;
-/* Inline hints are reasons why inline heuristics should preffer inlining given function.
- They are represtented as bitmap of the following values. */
+/* Inline hints are reasons why inline heuristics should preffer inlining given
+ function. They are represtented as bitmap of the following values. */
enum inline_hints_vals {
+ /* When inlining turns indirect call into a direct call,
+ it is good idea to do so. */
INLINE_HINT_indirect_call = 1,
+ /* Inlining may make loop iterations or loop stride known. It is good idea
+ to do so because it enables loop optimizatoins. */
INLINE_HINT_loop_iterations = 2,
INLINE_HINT_loop_stride = 4,
+ /* Inlining withing same strongly connected component of callgraph is often
+ a loss due to increased stack frame usage and prologue setup costs. */
INLINE_HINT_same_scc = 8,
+ /* Inlining functions in strongly connected component is not such a great
+ win. */
INLINE_HINT_in_scc = 16,
+ /* If function is declared inline by user, it may be good idea to inline
+ it. */
INLINE_HINT_declared_inline = 32,
- INLINE_HINT_cross_module = 64
+ /* Programs are usually still organized for non-LTO compilation and thus
+ if functions are in different modules, inlining may not be so important.
+ */
+ INLINE_HINT_cross_module = 64,
+ /* If array indexes of loads/stores become known there may be room for
+ futher optimization. */
+ INLINE_HINT_array_index = 128
};
typedef int inline_hints;
@@ -133,6 +149,8 @@ struct GTY(()) inline_summary
/* Predicate on when some loop in the function becomes to have known
stride. */
struct predicate * GTY((skip)) loop_stride;
+ /* Predicate on when some array indexes become constants. */
+ struct predicate * GTY((skip)) array_index;
/* Estimated growth for inlining all copies of the function before start
of small functions inlining.
This value will get out of date as the callers are duplicated, but