This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Wrong check in cgraphunit?
- From: Jan Hubicka <jh at suse dot cz>
- To: Steven Bosscher <stevenb at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org, jh at suse dot cz
- Date: Fri, 11 Jun 2004 16:54:18 +0200
- Subject: Re: Wrong check in cgraphunit?
- References: <200406101954.01936.stevenb@suse.de>
> 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