This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Put scope blocks on a diet
- From: Diego Novillo <dnovillo at google dot com>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 24 Jul 2007 15:13:18 -0400
- Subject: Re: Put scope blocks on a diet
- References: <20070724180235.GM24519@kam.mff.cuni.cz>
On 7/24/07 2:02 PM, Jan Hubicka wrote:
> * gimple-low.c (lower_stmt): When not doing debugging, don't save
> info about block.
> * tree-ssa-live.c: Include debug.h and flags.h.
> (mark_scope_block_unused): New function.
> (remove_unused_scope_block_p): New function.
> (remove_unused_locals): Remove unused blocks too.
OK with a few minor changes
> Index: gimple-low.c
> ===================================================================
> --- gimple-low.c (revision 126859)
> +++ gimple-low.c (working copy)
> @@ -210,7 +210,9 @@ lower_stmt (tree_stmt_iterator *tsi, str
> {
> tree stmt = tsi_stmt (*tsi);
>
> - if (EXPR_HAS_LOCATION (stmt) && data)
> + if (EXPR_HAS_LOCATION (stmt) && data
&& data on the next line
> tree t = *tp;
> + char const c = TREE_CODE_CLASS (TREE_CODE (t));
Hmm? TREE_CODE_CLASS is of type enum tree_code_class.
>
> +/* Mark the scope block SCOPE and is subblocks unused when they can be
s/is/its/
> +
> +/* Look if the block is dead (by possibly elliminating it's dead subblocks)
s/elliminating/eliminating/
s/it's/its/
> + and return true if so.
> + Block is declared dead if:
> + 1) No statements are associated with it.
> + 2) Declares no live variables
> + 3) All subblocks are dead
> + or there is precisely one subblocks and the block
> + has same abstract origin as outer block and declares
> + no variables, so it is pure wrapper.
> + When we are not outputting full debug info, we also elliminate dead variables
> + out of scope blocks to let them to be recycled by GGC and to save copying work
> + done by the inliner.
> +*/
Closing comment on previous line.
> + mark_scope_block_unused (DECL_INITIAL (current_function_decl));
Comment before '/* Assume every block in the function is unused. */'