>>>
>>>> - ipa-pta (disabled by default, -fno-ipa-pta)
>>>> - ipa-reference (list of accessed/modified global vars), disable by
>>>> -fno-ipa-refernece
>>>> - stack alignment requirements (no flag to disable)
>>>
>>> Would it be possible to add flag for it? Can you please point to a location
>>> where
>>> the optimization happen?
>
> In expand_call
>
> /* Figure out the amount to which the stack should be aligned. */
> preferred_stack_boundary = PREFERRED_STACK_BOUNDARY;
> if (fndecl)
> {
> struct cgraph_rtl_info *i = cgraph_node::rtl_info (fndecl);
> /* Without automatic stack alignment, we can't increase preferred
> stack boundary. With automatic stack alignment, it is
> unnecessary since unless we can guarantee that all callers will
> align the outgoing stack properly, callee has to align its
> stack anyway. */
> if (i
> && i->preferred_incoming_stack_boundary
> && i->preferred_incoming_stack_boundary < preferred_stack_boundary)
> preferred_stack_boundary = i->preferred_incoming_stack_boundary;
> }
>
As I checked, in the above, i->preferred_incoming_stack_boundary is set to
non-zero
when "decl_binds_to_current_def_p ()” is TRUE as the following: (in
rest_of_clean_state()
of final.c)
/* We can reduce stack alignment on call site only when we are sure that
the function body just produced will be actually used in the final
executable. */
if (decl_binds_to_current_def_p (current_function_decl))
{
unsigned int pref = crtl->preferred_stack_boundary;
if (crtl->stack_alignment_needed > crtl->preferred_stack_boundary)
pref = crtl->stack_alignment_needed;
cgraph_node::rtl_info (current_function_decl)
->preferred_incoming_stack_boundary = pref;
}
It looks like that “decl_binds_to_current_def_p()” will be FALSE when the
routine
is live-patched, right?
So, should we disable all the places that guided by
“decl_binds_to_current_def_p()”?
thanks.
Qing