Use sample profile information for call graph node weights. The profile
file is specified in the argument.
+fauto-profile-inlining
+Common Var(flag_auto_profile_inlining) Init(1) Optimization
+Perform inlining using auto-profile.
+
; -fcheck-bounds causes gcc to generate array bounds checks.
; For C, C++ and ObjC: defaults off.
; For Java: defaults to on.
-fmin-function-alignment=[@var{n}]
-fno-allocation-dce -fallow-store-data-races
-fassociative-math -fauto-profile -fauto-profile[=@var{path}]
--fauto-inc-dec -fbranch-probabilities
+-fauto-profile-inlining -fauto-inc-dec -fbranch-probabilities
-fcaller-saves
-fcombine-stack-adjustments -fconserve-stack
-ffold-mem-offsets
create_gcov --binary=your_program.unstripped --profile=perf.data \
--gcov=profile.afdo
@end smallexample
+
+@opindex fauto-profile-inlining
+@item -fauto-profile-inlining
+When auto-profile is available inline all relevant functions which was
+inlined in the tran run before reading the profile feedback. This improves
+context sensitivity of the profile. Enabled by default.
@end table
The following options control compiler behavior regarding floating-point
static bool
inline_functions_by_afdo (struct cgraph_node *node, bool *speculative_calls)
{
- if (!flag_auto_profile)
+ if (!flag_auto_profile || !flag_auto_profile_inlining)
return false;
struct cgraph_edge *e;
bool inlined = false;
fprintf (dump_file, "Iterations: %i\n", iterations);
}
+ /* do AFDO inlining in case it was not done as part of early inlining. */
+ if (optimize
+ && !flag_no_inline
+ && !flag_early_inlining
+ && flag_auto_profile_inlining)
+ {
+ bool speculative_calls = false;
+ inlined |= inline_functions_by_afdo (node, &speculative_calls);
+ if (speculative_calls)
+ {
+ cgraph_edge *next;
+ for (cgraph_edge *e = node->callees; e; e = next)
+ {
+ next = e->next_callee;
+ cgraph_edge::redirect_call_stmt_to_callee (e);
+ }
+ }
+ }
+
if (inlined)
{
timevar_push (TV_INTEGRATION);