[PATCH] inliner: Remove unused transform_lang_insert_block hook
Hi! This struct copy_body_data's hook is always NULL since merge of the tuples branch, before that it has been shortly used by the C++ FE during ctor/dtor cloning to chain the remapped blocks, but only very shortly, before transform_lang_insert_block was a bool and the call to insert_block was done through a langhook. I'd say that for something that hasn't been used since 4.4 there is zero chance we'll want to use it again in the near future. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2021-11-23 Jakub Jelinek gcc/ * tree-inline.h (struct copy_body_data): Remove transform_lang_insert_block member. * tree-inline.c (remap_block): Don't call id->transform_lang_insert_block. (optimize_inline_calls, copy_gimple_seq_and_replace_locals, tree_function_versioning, maybe_inline_call_in_expr, copy_fn): Don't initialize id.transform_lang_insert_block. * gimplify.c (gimplify_omp_loop): Likewise. gcc/c/ * c-typeck.c (c_clone_omp_udr): Don't initialize id.transform_lang_insert_block. gcc/cp/ * semantics.c (clone_omp_udr): Don't initialize id.transform_lang_insert_block. * optimize.c (clone_body): Likewise. --- gcc/tree-inline.h.jj2021-05-04 21:02:24.181799753 +0200 +++ gcc/tree-inline.h 2021-11-22 13:17:15.330592766 +0100 @@ -133,9 +133,6 @@ struct copy_body_data and only in that case will actually remap the type. */ bool dont_remap_vla_if_no_change; - /* A function to be called when duplicating BLOCK nodes. */ - void (*transform_lang_insert_block) (tree); - /* Statements that might be possibly folded. */ hash_set *statements_to_fold; --- gcc/tree-inline.c.jj2021-11-19 16:39:51.669594099 +0100 +++ gcc/tree-inline.c 2021-11-22 13:17:30.429377127 +0100 @@ -823,9 +823,6 @@ remap_block (tree *block, copy_body_data &BLOCK_NONLOCALIZED_VARS (new_block), id); - if (id->transform_lang_insert_block) -id->transform_lang_insert_block (new_block); - /* Remember the remapped block. */ insert_decl_map (id, old_block, new_block); } @@ -5473,7 +5470,6 @@ optimize_inline_calls (tree fn) id.transform_new_cfg = false; id.transform_return_to_modify = true; id.transform_parameter = true; - id.transform_lang_insert_block = NULL; id.statements_to_fold = new hash_set; push_gimplify_context (); @@ -5857,7 +5853,6 @@ copy_gimple_seq_and_replace_locals (gimp id.transform_new_cfg = false; id.transform_return_to_modify = false; id.transform_parameter = false; - id.transform_lang_insert_block = NULL; /* Walk the tree once to find local labels. */ memset (&wi, 0, sizeof (wi)); @@ -6252,7 +6247,6 @@ tree_function_versioning (tree old_decl, id.transform_new_cfg = true; id.transform_return_to_modify = false; id.transform_parameter = false; - id.transform_lang_insert_block = NULL; old_entry_block = ENTRY_BLOCK_PTR_FOR_FN (DECL_STRUCT_FUNCTION (old_decl)); @@ -6541,7 +6535,6 @@ maybe_inline_call_in_expr (tree exp) id.transform_new_cfg = false; id.transform_return_to_modify = true; id.transform_parameter = true; - id.transform_lang_insert_block = NULL; /* Make sure not to unshare trees behind the front-end's back since front-end specific mechanisms may rely on sharing. */ @@ -6613,7 +6606,6 @@ copy_fn (tree fn, tree& parms, tree& res id.transform_new_cfg = false; id.transform_return_to_modify = false; id.transform_parameter = true; - id.transform_lang_insert_block = NULL; /* Make sure not to unshare trees behind the front-end's back since front-end specific mechanisms may rely on sharing. */ --- gcc/gimplify.c.jj 2021-11-22 16:14:18.365451780 +0100 +++ gcc/gimplify.c 2021-11-22 16:54:31.726082428 +0100 @@ -13413,7 +13413,6 @@ gimplify_omp_loop (tree *expr_p, gimple_ id.transform_call_graph_edges = CB_CGE_DUPLICATE; id.transform_new_cfg = true; id.transform_return_to_modify = false; - id.transform_lang_insert_block = NULL; id.eh_lp_nr = 0; walk_tree (&OMP_CLAUSE_REDUCTION_INIT (*pc), copy_tree_body_r, &id, NULL); --- gcc/c/c-typeck.c.jj 2021-11-22 10:07:01.305225923 +0100 +++ gcc/c/c-typeck.c2021-11-22 13:18:20.678659463 +0100 @@ -13848,7 +13848,6 @@ c_clone_omp_udr (tree stmt, tree omp_dec id.transform_call_graph_edges = CB_CGE_DUPLICATE; id.transform_new_cfg = true; id.transform_return_to_modify = false; - id.transform_lang_insert_block = NULL; id.eh_lp_nr = 0; walk_tree (&stmt, copy_tree_body_r, &id, NULL); return stmt; --- gcc/cp/semantics.c.jj 2021-11-19 09:58:37.239716820 +0100 +++ gcc/cp/semantics.c 2021-11-22 13:18:40.604374884 +0100 @@ -6066,7 +6066,6 @@ clone_omp_udr (tree stmt, tree omp_decl1 id.t
Re: [PATCH] inliner: Remove unused transform_lang_insert_block hook
On Tue, 23 Nov 2021, Jakub Jelinek wrote: > Hi! > > This struct copy_body_data's hook is always NULL since merge > of the tuples branch, before that it has been shortly used by the C++ > FE during ctor/dtor cloning to chain the remapped blocks, but only > very shortly, before transform_lang_insert_block was a bool and > the call to insert_block was done through a langhook. > I'd say that for something that hasn't been used since 4.4 there is > zero chance we'll want to use it again in the near future. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? OK. Richard. > 2021-11-23 Jakub Jelinek > > gcc/ > * tree-inline.h (struct copy_body_data): Remove > transform_lang_insert_block member. > * tree-inline.c (remap_block): Don't call > id->transform_lang_insert_block. > (optimize_inline_calls, copy_gimple_seq_and_replace_locals, > tree_function_versioning, maybe_inline_call_in_expr, > copy_fn): Don't initialize id.transform_lang_insert_block. > * gimplify.c (gimplify_omp_loop): Likewise. > gcc/c/ > * c-typeck.c (c_clone_omp_udr): Don't initialize > id.transform_lang_insert_block. > gcc/cp/ > * semantics.c (clone_omp_udr): Don't initialize > id.transform_lang_insert_block. > * optimize.c (clone_body): Likewise. > > --- gcc/tree-inline.h.jj 2021-05-04 21:02:24.181799753 +0200 > +++ gcc/tree-inline.h 2021-11-22 13:17:15.330592766 +0100 > @@ -133,9 +133,6 @@ struct copy_body_data > and only in that case will actually remap the type. */ >bool dont_remap_vla_if_no_change; > > - /* A function to be called when duplicating BLOCK nodes. */ > - void (*transform_lang_insert_block) (tree); > - >/* Statements that might be possibly folded. */ >hash_set *statements_to_fold; > > --- gcc/tree-inline.c.jj 2021-11-19 16:39:51.669594099 +0100 > +++ gcc/tree-inline.c 2021-11-22 13:17:30.429377127 +0100 > @@ -823,9 +823,6 @@ remap_block (tree *block, copy_body_data > &BLOCK_NONLOCALIZED_VARS (new_block), > id); > > - if (id->transform_lang_insert_block) > -id->transform_lang_insert_block (new_block); > - >/* Remember the remapped block. */ >insert_decl_map (id, old_block, new_block); > } > @@ -5473,7 +5470,6 @@ optimize_inline_calls (tree fn) >id.transform_new_cfg = false; >id.transform_return_to_modify = true; >id.transform_parameter = true; > - id.transform_lang_insert_block = NULL; >id.statements_to_fold = new hash_set; > >push_gimplify_context (); > @@ -5857,7 +5853,6 @@ copy_gimple_seq_and_replace_locals (gimp >id.transform_new_cfg = false; >id.transform_return_to_modify = false; >id.transform_parameter = false; > - id.transform_lang_insert_block = NULL; > >/* Walk the tree once to find local labels. */ >memset (&wi, 0, sizeof (wi)); > @@ -6252,7 +6247,6 @@ tree_function_versioning (tree old_decl, >id.transform_new_cfg = true; >id.transform_return_to_modify = false; >id.transform_parameter = false; > - id.transform_lang_insert_block = NULL; > >old_entry_block = ENTRY_BLOCK_PTR_FOR_FN > (DECL_STRUCT_FUNCTION (old_decl)); > @@ -6541,7 +6535,6 @@ maybe_inline_call_in_expr (tree exp) >id.transform_new_cfg = false; >id.transform_return_to_modify = true; >id.transform_parameter = true; > - id.transform_lang_insert_block = NULL; > >/* Make sure not to unshare trees behind the front-end's back >since front-end specific mechanisms may rely on sharing. */ > @@ -6613,7 +6606,6 @@ copy_fn (tree fn, tree& parms, tree& res >id.transform_new_cfg = false; >id.transform_return_to_modify = false; >id.transform_parameter = true; > - id.transform_lang_insert_block = NULL; > >/* Make sure not to unshare trees behind the front-end's back > since front-end specific mechanisms may rely on sharing. */ > --- gcc/gimplify.c.jj 2021-11-22 16:14:18.365451780 +0100 > +++ gcc/gimplify.c2021-11-22 16:54:31.726082428 +0100 > @@ -13413,7 +13413,6 @@ gimplify_omp_loop (tree *expr_p, gimple_ > id.transform_call_graph_edges = CB_CGE_DUPLICATE; > id.transform_new_cfg = true; > id.transform_return_to_modify = false; > - id.transform_lang_insert_block = NULL; > id.eh_lp_nr = 0; > walk_tree (&OMP_CLAUSE_REDUCTION_INIT (*pc), copy_tree_body_r, > &id, NULL); > --- gcc/c/c-typeck.c.jj 2021-11-22 10:07:01.305225923 +0100 > +++ gcc/c/c-typeck.c 2021-11-22 13:18:20.678659463 +0100 > @@ -13848,7 +13848,6 @@ c_clone_omp_udr (tree stmt, tree omp_dec >id.transform_call_graph_edges = CB_CGE_DUPLICATE; >id.transform_new_cfg = true; >id.transform_return_to_modify = false; > - id.transform_lang_insert_block = NULL; >id.eh_lp_nr = 0; >walk_tree (&stmt, copy_tree_body