Some cleanups for the tree inliner.

Jan Hubicka hubicka@ucw.cz
Fri Aug 1 11:49:00 GMT 2003


> Hi,
> 
> This is an attempt to cleanup the tree inliner a bit, and to get more
> useful warnings out of -Winline.
Thanks! This is something in my TODO list for a while.
> 
> The first things it does, is move around some macros.  DID_INLINE_FUNC
> was used to mark functions that were inlinable because of
> -finline-functions.  So DID_INLINE_FUNC(fn) should be equivalent to
> !DECL_DECLARED_INLINE (fn).  The latter was defined in cp-tree.h and
> c-tree.h and used an extra bit in an extra struct c_lang_decl.  Cleaned
> up by moving DECL_DECLARED_INLINE to tree.h.
> 
> DECL_ESTIMATED_INSNS came in with Jan's new function body size
> estimates.  On the tree-ssa branch, this macro is in tree.h, but on
> mainline it was in c-common.h and java-tree.h, this patch changes that.
> 
> Finally, the nolimit argument to inlinable_function_p() was annoying. 
> This patch splits up this function in two: inlinable_function_p() which
> checks if there are any show-stoppers for inlining in the function body,
> and limits_allow_inlining() to control function growth.
> 
> This patch modifies the behavior of the compiler in two different ways:
> - It adds warnings to tell the user that functions calling alloca
>   or __builtin_longjmp (ie. using sjlj exceptions) cannot be inlined. 
>   This means that the user now first gets a warning about this, and
>   then another warning for each place where inlining failed.
Perhaps we can avoid a warning second time.
In theory UNINLINABLE flag can be set only when such things are done as
checking overflow of inlining limits is cheap.  So only
inlibable_function_p would play with UNINLINABLE patch and
limits_allow_inlining would be used each time when unit-at-a-time is not
in action. (unit-at-a-time should not use it at all now, right?)
> - It fixes the throttle to take into account the difference between
>   MAX_INLINE_INSNS_SINGLE and MAX_INLINE_INSNS_AUTO.  This is a bug
>   in the current inliner that allows auto-inlining functions larger
>   than MAX_INLINE_INSNS_AUTO when throttling.
In non-unit-at-a-time, right?

Thank you for the work!
Honza



More information about the Gcc-patches mailing list