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: ICF versus inlining


On Wed, Jan 28, 2015 at 11:03 PM, Jan Hubicka <hubicka@ucw.cz> wrote:
> Hi,
> the PR is about function not being inlined because it is called via a wrapper
> introduced by ICF merging code. cgraph_node::create_wrapper set
> call_stmt_cannot_inline_p that I suggested to Martin to try to figure out how
> much of merging is undone by inliner.  It was not meant to get into mainline.
>
> Because the wrappers may end up at performance critical places, I also added
> profile mainteinance - otherwise all BBs will get count of 0 and after
> inlining we end up with lousy code with -fprofile-use.
>
> To get sane inlining we probably want to make inliner to realize that call
> cost in thunk is minimal.  I will look into that incrementally.
>
> Bootstrapped/regtested x86_64-linux, will commit shortly.
>
>         PR ipa/64801
>         * gcc.dg/tree-ssa/pr64801.c: New testcase.
>         * cgraphunit.c (init_lowered_empty_function): Add CoUNT parameter;
>         make sane BB profile.
>         (cgraph_node::expand_thunk): Make sane BB profile.
>         (cgraph_node::create_wrapper): Do not set call_stmt_cannot_inline_p.
>         * cgraph.h (init_lowered_empty_function): Update prototype.
>         * config/i386/i386.c (make_resolver_func): Update call.
>         * predict.c (gate): Disable branch prediction pass if
>         profile is already there.
>
> Index: testsuite/gcc.dg/tree-ssa/pr64801.c
> ===================================================================
> --- testsuite/gcc.dg/tree-ssa/pr64801.c (revision 0)
> +++ testsuite/gcc.dg/tree-ssa/pr64801.c (revision 0)
> @@ -0,0 +1,21 @@
> +/* { dg-do compile } */
> +/* { dg-options "-O2 -fdump-tree-optimized" } */
> +int a;
> +int
> +elantech_detect (void)
> +{
> +  return -38;
> +}
> +inline int
> +fsp_detect (void)
> +{
> +  return -38;
> +}
> +void
> +psmouse_extensions (void)
> +{
> +  int (*b)() = fsp_detect;
> +  a = b ();
> +}
> +/* { dg-final { scan-tree-dump-not "fsp_detect"} } */
> +/* { dg-final { cleanup-tree-dump "optimized" } } */

I got

ERROR: gcc.dg/tree-ssa/pr64801.c: error executing dg-final:
scan-tree-dump-not: too few arguments



-- 
H.J.


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