This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] ipa-inline.c cleanups


On Saturday 23 July 2005 00:01, Josh Conner wrote:
> Attached are three patches that clean up small issues in ipa-inline.c.
>
> 1) adjustment for nesting in cgraph_edge_badness is backward if
> badness is < 0.

Instead of your patch, how about something like:
-     badness >>= nest;
+     badness = badness / (1 << nest); 

(modulo errors, it's late here ;-)


> 2) fix for failed inlining diagnostics

! 	  && (!node->local.inlinable || !cgraph_default_inline_p (node, 0))))

Should be s/0/NULL/ I suppose.  Otherwise, this looks OK to me
(but I can't approve it of course).

> 3) comment fixes in cgraph_edge_badness
> These comments refer to wanting to use "loop depth" and "frequency
> information", but I think both of those are already used in the
> function.

This looks like an oversight when the profile stuff was added.

> Also, the comments claim that returning MAX_INT prevents a function
> from being inlined, but I can't see any evidence of that being true.

Another oversight?
This patch also looks OK to me.

Gr.
Steven



P.S. Note unrelated to your patch, I noticed this nicety:
"int badness = cgraph_estimate_growth (edge->callee) * 256;".  This
is going to be fun with very large functions (e.g. 2GB and up, like
those supported in the large code model of the AMD64 ABI).  Honza,
is this overflow-safe??


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]