1 1.1 mrg /* IPA function body analysis. 2 1.1.1.4 mrg Copyright (C) 2003-2022 Free Software Foundation, Inc. 3 1.1 mrg Contributed by Jan Hubicka 4 1.1 mrg 5 1.1 mrg This file is part of GCC. 6 1.1 mrg 7 1.1 mrg GCC is free software; you can redistribute it and/or modify it under 8 1.1 mrg the terms of the GNU General Public License as published by the Free 9 1.1 mrg Software Foundation; either version 3, or (at your option) any later 10 1.1 mrg version. 11 1.1 mrg 12 1.1 mrg GCC is distributed in the hope that it will be useful, but WITHOUT ANY 13 1.1 mrg WARRANTY; without even the implied warranty of MERCHANTABILITY or 14 1.1 mrg FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 15 1.1 mrg for more details. 16 1.1 mrg 17 1.1 mrg You should have received a copy of the GNU General Public License 18 1.1 mrg along with GCC; see the file COPYING3. If not see 19 1.1 mrg <http://www.gnu.org/licenses/>. */ 20 1.1 mrg 21 1.1 mrg #ifndef GCC_IPA_SUMMARY_H 22 1.1 mrg #define GCC_IPA_SUMMARY_H 23 1.1 mrg 24 1.1 mrg #include "sreal.h" 25 1.1 mrg #include "ipa-predicate.h" 26 1.1 mrg 27 1.1 mrg 28 1.1.1.3 mrg /* Hints are reasons why IPA heuristics should prefer specializing given 29 1.1.1.3 mrg function. They are represented as bitmap of the following values. */ 30 1.1 mrg enum ipa_hints_vals { 31 1.1 mrg /* When specialization turns indirect call into a direct call, 32 1.1 mrg it is good idea to do so. */ 33 1.1 mrg INLINE_HINT_indirect_call = 1, 34 1.1 mrg /* Inlining may make loop iterations or loop stride known. It is good idea 35 1.1.1.3 mrg to do so because it enables loop optimizations. */ 36 1.1 mrg INLINE_HINT_loop_iterations = 2, 37 1.1 mrg INLINE_HINT_loop_stride = 4, 38 1.1 mrg /* Inlining within same strongly connected component of callgraph is often 39 1.1 mrg a loss due to increased stack frame usage and prologue setup costs. */ 40 1.1 mrg INLINE_HINT_same_scc = 8, 41 1.1 mrg /* Inlining functions in strongly connected component is not such a great 42 1.1 mrg win. */ 43 1.1 mrg INLINE_HINT_in_scc = 16, 44 1.1 mrg /* If function is declared inline by user, it may be good idea to inline 45 1.1.1.4 mrg it. Set by simple_edge_hints in ipa-inline-analysis.cc. */ 46 1.1 mrg INLINE_HINT_declared_inline = 32, 47 1.1 mrg /* Programs are usually still organized for non-LTO compilation and thus 48 1.1 mrg if functions are in different modules, inlining may not be so important. 49 1.1.1.4 mrg Set by simple_edge_hints in ipa-inline-analysis.cc. */ 50 1.1 mrg INLINE_HINT_cross_module = 64, 51 1.1 mrg /* We know that the callee is hot by profile. */ 52 1.1.1.4 mrg INLINE_HINT_known_hot = 128, 53 1.1.1.4 mrg /* There is builtin_constant_p dependent on parameter which is usually 54 1.1.1.4 mrg a strong hint to inline. */ 55 1.1.1.4 mrg INLINE_HINT_builtin_constant_p = 256 56 1.1 mrg }; 57 1.1 mrg 58 1.1 mrg typedef int ipa_hints; 59 1.1 mrg 60 1.1 mrg /* Simple description of whether a memory load or a condition refers to a load 61 1.1 mrg from an aggregate and if so, how and where from in the aggregate. 62 1.1 mrg Individual fields have the same meaning like fields with the same name in 63 1.1 mrg struct condition. */ 64 1.1 mrg 65 1.1 mrg struct agg_position_info 66 1.1 mrg { 67 1.1 mrg HOST_WIDE_INT offset; 68 1.1 mrg bool agg_contents; 69 1.1 mrg bool by_ref; 70 1.1 mrg }; 71 1.1 mrg 72 1.1 mrg /* Representation of function body size and time depending on the call 73 1.1 mrg context. We keep simple array of record, every containing of predicate 74 1.1 mrg and time/size to account. */ 75 1.1.1.4 mrg class size_time_entry 76 1.1 mrg { 77 1.1.1.3 mrg public: 78 1.1 mrg /* Predicate for code to be executed. */ 79 1.1.1.4 mrg ipa_predicate exec_predicate; 80 1.1 mrg /* Predicate for value to be constant and optimized out in a specialized copy. 81 1.1 mrg When deciding on specialization this makes it possible to see how much 82 1.1 mrg the executed code paths will simplify. */ 83 1.1.1.4 mrg ipa_predicate nonconst_predicate; 84 1.1 mrg int size; 85 1.1.1.4 mrg sreal time; 86 1.1 mrg }; 87 1.1 mrg 88 1.1.1.3 mrg /* Summary about function and stack frame sizes. We keep this info 89 1.1.1.3 mrg for inline clones and also for WPA streaming. For this reason this is not 90 1.1.1.3 mrg part of ipa_fn_summary which exists only for offline functions. */ 91 1.1.1.3 mrg class ipa_size_summary 92 1.1.1.3 mrg { 93 1.1.1.3 mrg public: 94 1.1.1.3 mrg /* Estimated stack frame consumption by the function. */ 95 1.1.1.3 mrg HOST_WIDE_INT estimated_self_stack_size; 96 1.1.1.3 mrg /* Size of the function body. */ 97 1.1.1.3 mrg int self_size; 98 1.1.1.3 mrg /* Estimated size of the function after inlining. */ 99 1.1.1.3 mrg int size; 100 1.1.1.3 mrg 101 1.1.1.3 mrg ipa_size_summary () 102 1.1.1.3 mrg : estimated_self_stack_size (0), self_size (0), size (0) 103 1.1.1.3 mrg { 104 1.1.1.3 mrg } 105 1.1.1.3 mrg }; 106 1.1.1.3 mrg 107 1.1.1.4 mrg /* Structure to capture how frequently some interesting events occur given a 108 1.1.1.4 mrg particular predicate. The structure is used to estimate how often we 109 1.1.1.4 mrg encounter loops with known iteration count or stride in various 110 1.1.1.4 mrg contexts. */ 111 1.1.1.4 mrg 112 1.1.1.4 mrg struct GTY(()) ipa_freqcounting_predicate 113 1.1.1.4 mrg { 114 1.1.1.4 mrg /* The described event happens with this frequency... */ 115 1.1.1.4 mrg sreal freq; 116 1.1.1.4 mrg /* ...when this predicate evaluates to false. */ 117 1.1.1.4 mrg ipa_predicate * GTY((skip)) predicate; 118 1.1.1.4 mrg }; 119 1.1.1.4 mrg 120 1.1 mrg /* Function inlining information. */ 121 1.1.1.3 mrg class GTY(()) ipa_fn_summary 122 1.1 mrg { 123 1.1.1.3 mrg public: 124 1.1.1.2 mrg /* Keep all field empty so summary dumping works during its computation. 125 1.1.1.2 mrg This is useful for debugging. */ 126 1.1.1.2 mrg ipa_fn_summary () 127 1.1.1.3 mrg : min_size (0), 128 1.1.1.2 mrg inlinable (false), single_caller (false), 129 1.1.1.4 mrg fp_expressions (false), target_info (0), 130 1.1.1.4 mrg estimated_stack_size (false), 131 1.1.1.3 mrg time (0), conds (NULL), 132 1.1.1.4 mrg size_time_table (), call_size_time_table (vNULL), 133 1.1.1.4 mrg loop_iterations (NULL), loop_strides (NULL), 134 1.1.1.4 mrg builtin_constant_p_parms (vNULL), 135 1.1.1.4 mrg growth (0), scc_no (0) 136 1.1.1.2 mrg { 137 1.1.1.2 mrg } 138 1.1.1.2 mrg 139 1.1.1.2 mrg /* Copy constructor. */ 140 1.1.1.2 mrg ipa_fn_summary (const ipa_fn_summary &s) 141 1.1.1.3 mrg : min_size (s.min_size), 142 1.1.1.2 mrg inlinable (s.inlinable), single_caller (s.single_caller), 143 1.1.1.2 mrg fp_expressions (s.fp_expressions), 144 1.1.1.4 mrg target_info (s.target_info), 145 1.1.1.2 mrg estimated_stack_size (s.estimated_stack_size), 146 1.1.1.4 mrg time (s.time), conds (s.conds), size_time_table (), 147 1.1.1.4 mrg call_size_time_table (vNULL), 148 1.1.1.4 mrg loop_iterations (s.loop_iterations), loop_strides (s.loop_strides), 149 1.1.1.4 mrg builtin_constant_p_parms (s.builtin_constant_p_parms), 150 1.1.1.3 mrg growth (s.growth), scc_no (s.scc_no) 151 1.1.1.2 mrg {} 152 1.1.1.2 mrg 153 1.1.1.2 mrg /* Default constructor. */ 154 1.1.1.2 mrg ~ipa_fn_summary (); 155 1.1.1.2 mrg 156 1.1 mrg /* Information about the function body itself. */ 157 1.1 mrg 158 1.1 mrg /* Minimal size increase after inlining. */ 159 1.1 mrg int min_size; 160 1.1 mrg 161 1.1 mrg /* False when there something makes inlining impossible (such as va_arg). */ 162 1.1 mrg unsigned inlinable : 1; 163 1.1 mrg /* True wen there is only one caller of the function before small function 164 1.1 mrg inlining. */ 165 1.1 mrg unsigned int single_caller : 1; 166 1.1 mrg /* True if function contains any floating point expressions. */ 167 1.1 mrg unsigned int fp_expressions : 1; 168 1.1.1.4 mrg /* Like fp_expressions field above, but it's to hold some target specific 169 1.1.1.4 mrg information, such as some target specific isa flags. Note that for 170 1.1.1.4 mrg offloading target compilers, this field isn't streamed. */ 171 1.1.1.4 mrg unsigned int target_info; 172 1.1 mrg 173 1.1 mrg /* Information about function that will result after applying all the 174 1.1 mrg inline decisions present in the callgraph. Generally kept up to 175 1.1 mrg date only for functions that are not inline clones. */ 176 1.1 mrg 177 1.1 mrg /* Estimated stack frame consumption by the function. */ 178 1.1 mrg HOST_WIDE_INT estimated_stack_size; 179 1.1.1.3 mrg /* Estimated runtime of function after inlining. */ 180 1.1 mrg sreal GTY((skip)) time; 181 1.1 mrg 182 1.1 mrg /* Conditional size/time information. The summaries are being 183 1.1 mrg merged during inlining. */ 184 1.1 mrg conditions conds; 185 1.1.1.3 mrg /* Normal code is accounted in size_time_table, while calls are 186 1.1.1.3 mrg accounted in call_size_time_table. This is because calls 187 1.1.1.3 mrg are often adjusted by IPA optimizations and thus this summary 188 1.1.1.3 mrg is generated from call summary information when needed. */ 189 1.1.1.4 mrg auto_vec<size_time_entry> GTY((skip)) size_time_table; 190 1.1.1.4 mrg /* Unlike size_time_table that is initialized for all summaries 191 1.1.1.4 mrg call_size_time_table is allocated only for functions with 192 1.1.1.4 mrg many calls. Use effecient vl_ptr storage. */ 193 1.1.1.4 mrg vec<size_time_entry, va_heap, vl_ptr> GTY((skip)) call_size_time_table; 194 1.1.1.4 mrg 195 1.1.1.4 mrg /* Predicates on when some loops in the function can have known bounds. */ 196 1.1.1.4 mrg vec<ipa_freqcounting_predicate, va_gc> *loop_iterations; 197 1.1.1.4 mrg /* Predicates on when some loops in the function can have known strides. */ 198 1.1.1.4 mrg vec<ipa_freqcounting_predicate, va_gc> *loop_strides; 199 1.1.1.4 mrg /* Parameters tested by builtin_constant_p. */ 200 1.1.1.4 mrg vec<int, va_heap, vl_ptr> GTY((skip)) builtin_constant_p_parms; 201 1.1 mrg /* Estimated growth for inlining all copies of the function before start 202 1.1 mrg of small functions inlining. 203 1.1 mrg This value will get out of date as the callers are duplicated, but 204 1.1 mrg using up-to-date value in the badness metric mean a lot of extra 205 1.1 mrg expenses. */ 206 1.1 mrg int growth; 207 1.1 mrg /* Number of SCC on the beginning of inlining process. */ 208 1.1 mrg int scc_no; 209 1.1 mrg 210 1.1 mrg /* Record time and size under given predicates. */ 211 1.1.1.4 mrg void account_size_time (int, sreal, const ipa_predicate &, 212 1.1.1.4 mrg const ipa_predicate &, 213 1.1.1.3 mrg bool call = false); 214 1.1 mrg 215 1.1 mrg /* We keep values scaled up, so fractional sizes can be accounted. */ 216 1.1 mrg static const int size_scale = 2; 217 1.1.1.3 mrg /* Maximal size of size_time_table before we start to be conservative. */ 218 1.1.1.3 mrg static const int max_size_time_table_size = 256; 219 1.1 mrg }; 220 1.1 mrg 221 1.1.1.2 mrg class GTY((user)) ipa_fn_summary_t: 222 1.1.1.2 mrg public fast_function_summary <ipa_fn_summary *, va_gc> 223 1.1 mrg { 224 1.1 mrg public: 225 1.1.1.2 mrg ipa_fn_summary_t (symbol_table *symtab): 226 1.1.1.2 mrg fast_function_summary <ipa_fn_summary *, va_gc> (symtab) {} 227 1.1 mrg 228 1.1 mrg static ipa_fn_summary_t *create_ggc (symbol_table *symtab) 229 1.1 mrg { 230 1.1.1.3 mrg class ipa_fn_summary_t *summary 231 1.1.1.3 mrg = new (ggc_alloc_no_dtor<ipa_fn_summary_t> ()) ipa_fn_summary_t (symtab); 232 1.1 mrg summary->disable_insertion_hook (); 233 1.1 mrg return summary; 234 1.1 mrg } 235 1.1 mrg 236 1.1.1.2 mrg /* Remove ipa_fn_summary for all callees of NODE. */ 237 1.1.1.2 mrg void remove_callees (cgraph_node *node); 238 1.1 mrg 239 1.1 mrg virtual void insert (cgraph_node *, ipa_fn_summary *); 240 1.1.1.2 mrg virtual void remove (cgraph_node *node, ipa_fn_summary *) 241 1.1.1.2 mrg { 242 1.1.1.2 mrg remove_callees (node); 243 1.1.1.2 mrg } 244 1.1.1.2 mrg 245 1.1 mrg virtual void duplicate (cgraph_node *src, cgraph_node *dst, 246 1.1 mrg ipa_fn_summary *src_data, ipa_fn_summary *dst_data); 247 1.1 mrg }; 248 1.1 mrg 249 1.1.1.2 mrg extern GTY(()) fast_function_summary <ipa_fn_summary *, va_gc> 250 1.1.1.2 mrg *ipa_fn_summaries; 251 1.1 mrg 252 1.1.1.3 mrg class ipa_size_summary_t: 253 1.1.1.3 mrg public fast_function_summary <ipa_size_summary *, va_heap> 254 1.1.1.3 mrg { 255 1.1.1.3 mrg public: 256 1.1.1.3 mrg ipa_size_summary_t (symbol_table *symtab): 257 1.1.1.3 mrg fast_function_summary <ipa_size_summary *, va_heap> (symtab) 258 1.1.1.3 mrg { 259 1.1.1.3 mrg disable_insertion_hook (); 260 1.1.1.3 mrg } 261 1.1.1.3 mrg 262 1.1.1.3 mrg virtual void duplicate (cgraph_node *, cgraph_node *, 263 1.1.1.3 mrg ipa_size_summary *src_data, 264 1.1.1.3 mrg ipa_size_summary *dst_data) 265 1.1.1.3 mrg { 266 1.1.1.3 mrg *dst_data = *src_data; 267 1.1.1.3 mrg } 268 1.1.1.3 mrg }; 269 1.1.1.3 mrg extern fast_function_summary <ipa_size_summary *, va_heap> 270 1.1.1.3 mrg *ipa_size_summaries; 271 1.1.1.3 mrg 272 1.1 mrg /* Information kept about callgraph edges. */ 273 1.1.1.3 mrg class ipa_call_summary 274 1.1 mrg { 275 1.1.1.3 mrg public: 276 1.1.1.2 mrg /* Keep all field empty so summary dumping works during its computation. 277 1.1.1.2 mrg This is useful for debugging. */ 278 1.1.1.2 mrg ipa_call_summary () 279 1.1.1.2 mrg : predicate (NULL), param (vNULL), call_stmt_size (0), call_stmt_time (0), 280 1.1.1.2 mrg loop_depth (0), is_return_callee_uncaptured (false) 281 1.1.1.2 mrg { 282 1.1.1.2 mrg } 283 1.1.1.2 mrg 284 1.1.1.2 mrg /* Copy constructor. */ 285 1.1.1.2 mrg ipa_call_summary (const ipa_call_summary &s): 286 1.1.1.2 mrg predicate (s.predicate), param (s.param), call_stmt_size (s.call_stmt_size), 287 1.1.1.2 mrg call_stmt_time (s.call_stmt_time), loop_depth (s.loop_depth), 288 1.1.1.2 mrg is_return_callee_uncaptured (s.is_return_callee_uncaptured) 289 1.1.1.2 mrg { 290 1.1.1.2 mrg } 291 1.1.1.2 mrg 292 1.1.1.2 mrg /* Default destructor. */ 293 1.1.1.2 mrg ~ipa_call_summary (); 294 1.1.1.2 mrg 295 1.1.1.4 mrg ipa_predicate *predicate; 296 1.1 mrg /* Vector indexed by parameters. */ 297 1.1 mrg vec<inline_param_summary> param; 298 1.1 mrg /* Estimated size and time of the call statement. */ 299 1.1 mrg int call_stmt_size; 300 1.1 mrg int call_stmt_time; 301 1.1 mrg /* Depth of loop nest, 0 means no nesting. */ 302 1.1 mrg unsigned int loop_depth; 303 1.1 mrg /* Indicates whether the caller returns the value of it's callee. */ 304 1.1 mrg bool is_return_callee_uncaptured; 305 1.1 mrg }; 306 1.1 mrg 307 1.1.1.2 mrg class ipa_call_summary_t: public fast_call_summary <ipa_call_summary *, va_heap> 308 1.1 mrg { 309 1.1 mrg public: 310 1.1.1.2 mrg ipa_call_summary_t (symbol_table *symtab): 311 1.1.1.2 mrg fast_call_summary <ipa_call_summary *, va_heap> (symtab) {} 312 1.1 mrg 313 1.1 mrg /* Hook that is called by summary when an edge is duplicated. */ 314 1.1 mrg virtual void duplicate (cgraph_edge *src, cgraph_edge *dst, 315 1.1 mrg ipa_call_summary *src_data, 316 1.1 mrg ipa_call_summary *dst_data); 317 1.1 mrg }; 318 1.1 mrg 319 1.1.1.4 mrg /* Estimated execution times, code sizes and other information about the 320 1.1.1.4 mrg code executing a call described by ipa_call_context. */ 321 1.1.1.4 mrg 322 1.1.1.4 mrg struct ipa_call_estimates 323 1.1.1.4 mrg { 324 1.1.1.4 mrg /* Estimated size needed to execute call in the given context. */ 325 1.1.1.4 mrg int size; 326 1.1.1.4 mrg 327 1.1.1.4 mrg /* Minimal size needed for the call that is + independent on the call context 328 1.1.1.4 mrg and can be used for fast estimates. */ 329 1.1.1.4 mrg int min_size; 330 1.1.1.4 mrg 331 1.1.1.4 mrg /* Estimated time needed to execute call in the given context. */ 332 1.1.1.4 mrg sreal time; 333 1.1.1.4 mrg 334 1.1.1.4 mrg /* Estimated time needed to execute the function when not ignoring 335 1.1.1.4 mrg computations known to be constant in this context. */ 336 1.1.1.4 mrg sreal nonspecialized_time; 337 1.1.1.4 mrg 338 1.1.1.4 mrg /* Further discovered reasons why to inline or specialize the give calls. */ 339 1.1.1.4 mrg ipa_hints hints; 340 1.1.1.4 mrg 341 1.1.1.4 mrg /* Frequency how often a loop with known number of iterations is encountered. 342 1.1.1.4 mrg Calculated with hints. */ 343 1.1.1.4 mrg sreal loops_with_known_iterations; 344 1.1.1.4 mrg 345 1.1.1.4 mrg /* Frequency how often a loop with known strides is encountered. Calculated 346 1.1.1.4 mrg with hints. */ 347 1.1.1.4 mrg sreal loops_with_known_strides; 348 1.1.1.4 mrg }; 349 1.1.1.4 mrg 350 1.1.1.4 mrg class ipa_cached_call_context; 351 1.1.1.4 mrg 352 1.1.1.3 mrg /* This object describe a context of call. That is a summary of known 353 1.1.1.3 mrg information about its parameters. Main purpose of this context is 354 1.1.1.3 mrg to give more realistic estimations of function runtime, size and 355 1.1.1.3 mrg inline hints. */ 356 1.1.1.3 mrg class ipa_call_context 357 1.1.1.3 mrg { 358 1.1.1.3 mrg public: 359 1.1.1.3 mrg ipa_call_context (cgraph_node *node, 360 1.1.1.3 mrg clause_t possible_truths, 361 1.1.1.3 mrg clause_t nonspec_possible_truths, 362 1.1.1.4 mrg vec<inline_param_summary> inline_param_summary, 363 1.1.1.4 mrg ipa_auto_call_arg_values *arg_values); 364 1.1.1.3 mrg ipa_call_context () 365 1.1.1.3 mrg : m_node(NULL) 366 1.1.1.3 mrg { 367 1.1.1.3 mrg } 368 1.1.1.4 mrg void estimate_size_and_time (ipa_call_estimates *estimates, 369 1.1.1.4 mrg bool est_times = true, bool est_hints = true); 370 1.1.1.3 mrg bool equal_to (const ipa_call_context &); 371 1.1.1.3 mrg bool exists_p () 372 1.1.1.3 mrg { 373 1.1.1.3 mrg return m_node != NULL; 374 1.1.1.3 mrg } 375 1.1.1.3 mrg private: 376 1.1.1.3 mrg /* Called function. */ 377 1.1.1.3 mrg cgraph_node *m_node; 378 1.1.1.3 mrg /* Clause describing what predicate conditionals can be satisfied 379 1.1.1.3 mrg in this context if function is inlined/specialized. */ 380 1.1.1.3 mrg clause_t m_possible_truths; 381 1.1.1.3 mrg /* Clause describing what predicate conditionals can be satisfied 382 1.1.1.3 mrg in this context if function is kept offline. */ 383 1.1.1.3 mrg clause_t m_nonspec_possible_truths; 384 1.1.1.3 mrg /* Inline summary maintains info about change probabilities. */ 385 1.1.1.3 mrg vec<inline_param_summary> m_inline_param_summary; 386 1.1.1.3 mrg 387 1.1.1.4 mrg /* Even after having calculated clauses, the information about argument 388 1.1.1.4 mrg values is used to resolve indirect calls. */ 389 1.1.1.4 mrg ipa_call_arg_values m_avals; 390 1.1.1.3 mrg 391 1.1.1.4 mrg friend ipa_cached_call_context; 392 1.1.1.4 mrg }; 393 1.1.1.4 mrg 394 1.1.1.4 mrg /* Variant of ipa_call_context that is stored in a cache over a longer period 395 1.1.1.4 mrg of time. */ 396 1.1.1.4 mrg 397 1.1.1.4 mrg class ipa_cached_call_context : public ipa_call_context 398 1.1.1.4 mrg { 399 1.1.1.4 mrg public: 400 1.1.1.4 mrg void duplicate_from (const ipa_call_context &ctx); 401 1.1.1.4 mrg void release (); 402 1.1.1.3 mrg }; 403 1.1.1.3 mrg 404 1.1.1.2 mrg extern fast_call_summary <ipa_call_summary *, va_heap> *ipa_call_summaries; 405 1.1 mrg 406 1.1.1.4 mrg /* In ipa-fnsummary.cc */ 407 1.1 mrg void ipa_debug_fn_summary (struct cgraph_node *); 408 1.1 mrg void ipa_dump_fn_summaries (FILE *f); 409 1.1 mrg void ipa_dump_fn_summary (FILE *f, struct cgraph_node *node); 410 1.1 mrg void ipa_dump_hints (FILE *f, ipa_hints); 411 1.1 mrg void ipa_free_fn_summary (void); 412 1.1.1.3 mrg void ipa_free_size_summary (void); 413 1.1 mrg void inline_analyze_function (struct cgraph_node *node); 414 1.1.1.4 mrg void estimate_ipcp_clone_size_and_time (struct cgraph_node *node, 415 1.1.1.4 mrg ipa_auto_call_arg_values *avals, 416 1.1.1.4 mrg ipa_call_estimates *estimates); 417 1.1 mrg void ipa_merge_fn_summary_after_inlining (struct cgraph_edge *edge); 418 1.1.1.3 mrg void ipa_update_overall_fn_summary (struct cgraph_node *node, bool reset = true); 419 1.1 mrg void compute_fn_summary (struct cgraph_node *, bool); 420 1.1.1.4 mrg bool refs_local_or_readonly_memory_p (tree); 421 1.1.1.4 mrg bool points_to_local_or_readonly_memory_p (tree); 422 1.1 mrg 423 1.1 mrg 424 1.1.1.3 mrg void evaluate_properties_for_edge (struct cgraph_edge *e, 425 1.1.1.3 mrg bool inline_p, 426 1.1 mrg clause_t *clause_ptr, 427 1.1 mrg clause_t *nonspec_clause_ptr, 428 1.1.1.4 mrg ipa_auto_call_arg_values *avals, 429 1.1.1.4 mrg bool compute_contexts); 430 1.1 mrg 431 1.1.1.4 mrg void ipa_fnsummary_cc_finalize (void); 432 1.1.1.3 mrg HOST_WIDE_INT ipa_get_stack_frame_offset (struct cgraph_node *node); 433 1.1.1.3 mrg void ipa_remove_from_growth_caches (struct cgraph_edge *edge); 434 1.1.1.3 mrg 435 1.1.1.3 mrg /* Return true if EDGE is a cross module call. */ 436 1.1.1.3 mrg 437 1.1.1.3 mrg static inline bool 438 1.1.1.3 mrg cross_module_call_p (struct cgraph_edge *edge) 439 1.1.1.3 mrg { 440 1.1.1.3 mrg /* Here we do not want to walk to alias target becuase ICF may create 441 1.1.1.3 mrg cross-unit aliases. */ 442 1.1.1.3 mrg if (edge->caller->unit_id == edge->callee->unit_id) 443 1.1.1.3 mrg return false; 444 1.1.1.3 mrg /* If the call is to a (former) comdat function or s symbol with mutiple 445 1.1.1.3 mrg extern inline definitions then treat is as in-module call. */ 446 1.1.1.3 mrg if (edge->callee->merged_extern_inline || edge->callee->merged_comdat 447 1.1.1.3 mrg || DECL_COMDAT (edge->callee->decl)) 448 1.1.1.3 mrg return false; 449 1.1.1.3 mrg return true; 450 1.1.1.3 mrg } 451 1.1 mrg 452 1.1 mrg #endif /* GCC_IPA_FNSUMMARY_H */ 453