public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Drop after_inlining check in remove_unused_locals
@ 2009-11-30 11:42 Richard Guenther
  2009-12-22  5:48 ` H.J. Lu
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Guenther @ 2009-11-30 11:42 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jan Hubicka, aoliva


This removes the after_inlining check in remove_unused_locals.  This
way we can avoid copying them during the inlining phases and save
some memory (about 4% for tramp3d).

The reasoning is simple, absolute UID differences may not matter
for code-generation, only the ordering of decls with respect to
their UID has to be stable across compilations (so this also
removes the need for the fancy UID namespace of DEBUG_EXPR_DECLs,
they could just use the regular UID namespace).

The after_inlining flag is now only used in an assert - I decided
to still leave it in.  Honza, any different opinion here?

Bootstrapped and tested on x86_64-unknown-linux-gnu, bootstrapped
with -O3 and -Os, bootstrapped with bootstrap-debug-lib as well,
all languages including Ada and obj-c++.

I will install this tomorrow, I have installed the prerequesites
already.

Thanks,
Richard.

2009-11-30  Richard Guenther  <rguenther@suse.de>

	* final.c (rest_of_clean_state): If -fcompare-debug is
	given dump final insns without UIDs.
	* tree-ssa-live.c (remove_unused_scope_block_p): Remove
	after_inlining checks.

Index: gcc/final.c
===================================================================
*** gcc/final.c.orig	2009-11-29 16:14:21.000000000 +0100
--- gcc/final.c	2009-11-29 16:19:50.000000000 +0100
*************** rest_of_clean_state (void)
*** 4382,4387 ****
--- 4382,4389 ----
  	     : "");
  
  	  flag_dump_noaddr = flag_dump_unnumbered = 1;
+ 	  if (flag_compare_debug_opt || flag_compare_debug)
+ 	    dump_flags |= TDF_NOUID;
  
  	  for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
  	    if (LABEL_P (insn))
Index: gcc/tree-ssa-live.c
===================================================================
*** gcc/tree-ssa-live.c.orig	2009-11-29 16:14:21.000000000 +0100
--- gcc/tree-ssa-live.c	2009-11-29 16:19:50.000000000 +0100
*************** remove_unused_scope_block_p (tree scope)
*** 475,485 ****
  	 type is used or not.  */
  
        else if (debug_info_level == DINFO_LEVEL_NORMAL
! 	       || debug_info_level == DINFO_LEVEL_VERBOSE
! 	       /* Removing declarations before inlining is going to affect
! 		  DECL_UID that in turn is going to affect hashtables and
! 		  code generation.  */
! 	       || !cfun->after_inlining)
  	;
        else
  	{
--- 475,481 ----
  	 type is used or not.  */
  
        else if (debug_info_level == DINFO_LEVEL_NORMAL
! 	       || debug_info_level == DINFO_LEVEL_VERBOSE)
  	;
        else
  	{
*************** remove_unused_scope_block_p (tree scope)
*** 527,538 ****
        eliminated.  */
     else if (!nsubblocks)
       ;
-    /* If there are live subblocks and we still have some unused variables
-       or types declared, we must keep them.
-       Before inliing we must not depend on debug info verbosity to keep
-       DECL_UIDs stable.  */
-    else if (!cfun->after_inlining && BLOCK_VARS (scope))
-      unused = false;
     /* For terse debug info we can eliminate info on unused variables.  */
     else if (debug_info_level == DINFO_LEVEL_NONE
  	    || debug_info_level == DINFO_LEVEL_TERSE)
--- 523,528 ----

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Drop after_inlining check in remove_unused_locals
  2009-11-30 11:42 [PATCH] Drop after_inlining check in remove_unused_locals Richard Guenther
@ 2009-12-22  5:48 ` H.J. Lu
  0 siblings, 0 replies; 2+ messages in thread
From: H.J. Lu @ 2009-12-22  5:48 UTC (permalink / raw)
  To: Richard Guenther; +Cc: gcc-patches, Jan Hubicka, aoliva

On Mon, Nov 30, 2009 at 3:23 AM, Richard Guenther <rguenther@suse.de> wrote:
>
> This removes the after_inlining check in remove_unused_locals.  This
> way we can avoid copying them during the inlining phases and save
> some memory (about 4% for tramp3d).
>
> The reasoning is simple, absolute UID differences may not matter
> for code-generation, only the ordering of decls with respect to
> their UID has to be stable across compilations (so this also
> removes the need for the fancy UID namespace of DEBUG_EXPR_DECLs,
> they could just use the regular UID namespace).
>
> The after_inlining flag is now only used in an assert - I decided
> to still leave it in.  Honza, any different opinion here?
>
> Bootstrapped and tested on x86_64-unknown-linux-gnu, bootstrapped
> with -O3 and -Os, bootstrapped with bootstrap-debug-lib as well,
> all languages including Ada and obj-c++.
>
> I will install this tomorrow, I have installed the prerequesites
> already.
>
> Thanks,
> Richard.
>
> 2009-11-30  Richard Guenther  <rguenther@suse.de>
>
>        * final.c (rest_of_clean_state): If -fcompare-debug is
>        given dump final insns without UIDs.
>        * tree-ssa-live.c (remove_unused_scope_block_p): Remove
>        after_inlining checks.

This patch caused:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42455

-- 
H.J.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-12-22  1:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-30 11:42 [PATCH] Drop after_inlining check in remove_unused_locals Richard Guenther
2009-12-22  5:48 ` H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).