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: Early inlining



On Jun 23, 2005, at 7:37 PM, Jan Hubicka wrote:


Hi,
this patch adds early inlining. As discussed earlier it helps
noticeably to cut down expenses of tree profiling on testcases with
extreme function call overhead (such as tramp3d). It also save memory
on Gerald's testcase and makes GCC module compilation test apparently
tinny bit faster at -O3 (but close to noise). In the future I would
like to have more optimizations in between the early inlining and real
inliing that will make this infrastructure bit more usefull, but at
the moment it seems to solve some side cases and have no measurable
overhead otherwise (even tought we rebuild cgraph edges after the early
passes) so I am enabling it by default now.
...

Jan -

After this patch, I see that static functions called once that are inlined are no longer removed from the CFG during actual (not early) inlining. Assuming this is the intended behavior, there is a slight issue that is raised in the function cgraph_decide_inlining(). This can be seen by compiling the attached test.c with "-O3 -fdump-ipa- all", producing a sefault. The problem is that when inlining functions called once (starting around ipa-inline.c:809), we call cgraph_mark_inline() which creates a duplicate callee node, resetting node->callers to NULL. With dumps enabled, this causes a null- pointer reference immediately after. The attached patch addresses the issue by holding on to the edge across the call to cgraph_mark_inline. I haven't run any regression tests on this yet, but I wanted to be sure that the original behavior of no longer removing CFG nodes was the intended behavior first.

Shall I kick off the tests?

- Josh
~~~~~~
Josh Conner

Attachment: test.c
Description: Binary data

Attachment: inl-dump.patch
Description: Binary data


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