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: Wrong check in cgraphunit?


> Hi,
> 
> I'm not completely sure about this one, but it looks like we are
> computing the growth of inlining functions that we have decided
> _not_ to inline in cgraph_estimate_growth:
> 
> /* Estimate the growth caused by inlining NODE into all callees.  */
> 
> static int
> cgraph_estimate_growth (struct cgraph_node *node)
> {
>   int growth = 0;
>   struct cgraph_edge *e;
> 
>   for (e = node->callers; e; e = e->next_caller)
>     if (e->inline_failed)
>       growth += (cgraph_estimate_size_after_inlining (1, e->caller, node)
>                  - e->caller->global.insns);
> 
>   /* a few more lines... */
> 
>   return growth;
> }
> 
> Now, e->inline_failed is non-NULL iff, well, inlining is not
> possible for some reason.

No, the code actually works by setting the inline_failed to dummy reason
claiming that function has not been considered for inliing first and
then gradually clearing the flag or setting it to proper reason.
The code growth estimation is done only before inlinnig takes place and
thus it really worry only about edges having inline_failed non-zero.

The naming scheme is ineed inconsistent but it is the only way around I
found without inventing redundant flag in the edges or something.
I plan to at least add accesor macro inline_edge that should make the
code more readable.

Honza


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