This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 1/5] Get rid off old external tree-sra.c stuff
- From: Martin Jambor <mjambor at suse dot cz>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 20 May 2009 12:19:32 +0200
- Subject: Re: [PATCH 1/5] Get rid off old external tree-sra.c stuff
- References: <20090428100429.051912011@virgil.suse.cz> <20090428100449.655827941@virgil.suse.cz> <alpine.LNX.2.00.0904281446340.25789@zhemvz.fhfr.qr>
On Tue, Apr 28, 2009 at 02:46:45PM +0200, Richard Guenther wrote:
> On Tue, 28 Apr 2009, Martin Jambor wrote:
>
> > This patch gets rid off all extermal things in the old tree-sra.
> > sra_insert_before, sra_insert_after sra_init_cache and
> > sra_type_can_be_decomposed_p are not actually used anywhere so they
> > are made static. insert_edge_copies_seq is used in mudflap and so I
> > copid the function there and made it static too. The original one had
> > to be moved upwards in the file do that tree-sra compiles. Yes, ths
> > patch duplicates the function but the origial copy is nuked with the
> > rest of the file by the next patch.
> >
> > Thanks,
> >
> > Martin
>
> This is ok.
Re-bootstrapped, re-tested and committed as revision 147733.
Thanks,
Martin
>
> Thanks,
> Richard.
>
> >
> > 2009-04-27 Martin Jambor <mjambor@suse.cz>
> >
> > * tree-flow.h (insert_edge_copies_seq): Undeclare.
> > (sra_insert_before): Likewise.
> > (sra_insert_after): Likewise.
> > (sra_init_cache): Likewise.
> > (sra_type_can_be_decomposed_p): Likewise.
> >
> > * tree-mudflap.c (insert_edge_copies_seq): Copied here from tree-sra.c
> >
> > * tree-sra.c (sra_type_can_be_decomposed_p): Made static.
> > (sra_insert_before): Likewise.
> > (sra_insert_after): Likewise.
> > (sra_init_cache): Likewise.
> > (insert_edge_copies_seq): Made static and moved upwards.
> >
> >
> > Index: mine/gcc/tree-flow.h
> > ===================================================================
> > --- mine.orig/gcc/tree-flow.h
> > +++ mine/gcc/tree-flow.h
> > @@ -873,13 +873,6 @@ tree vn_lookup_with_vuses (tree, VEC (tr
> > /* In tree-ssa-sink.c */
> > bool is_hidden_global_store (gimple);
> >
> > -/* In tree-sra.c */
> > -void insert_edge_copies_seq (gimple_seq, basic_block);
> > -void sra_insert_before (gimple_stmt_iterator *, gimple_seq);
> > -void sra_insert_after (gimple_stmt_iterator *, gimple_seq);
> > -void sra_init_cache (void);
> > -bool sra_type_can_be_decomposed_p (tree);
> > -
> > /* In tree-loop-linear.c */
> > extern void linear_transform_loops (void);
> > extern unsigned perfect_loop_nest_depth (struct loop *);
> > Index: mine/gcc/tree-mudflap.c
> > ===================================================================
> > --- mine.orig/gcc/tree-mudflap.c
> > +++ mine/gcc/tree-mudflap.c
> > @@ -447,6 +447,26 @@ execute_mudflap_function_ops (void)
> > return 0;
> > }
> >
> > +/* Insert a gimple_seq SEQ on all the outgoing edges out of BB. Note that
> > + if BB has more than one edge, STMT will be replicated for each edge.
> > + Also, abnormal edges will be ignored. */
> > +
> > +static void
> > +insert_edge_copies_seq (gimple_seq seq, basic_block bb)
> > +{
> > + edge e;
> > + edge_iterator ei;
> > + unsigned n_copies = -1;
> > +
> > + FOR_EACH_EDGE (e, ei, bb->succs)
> > + if (!(e->flags & EDGE_ABNORMAL))
> > + n_copies++;
> > +
> > + FOR_EACH_EDGE (e, ei, bb->succs)
> > + if (!(e->flags & EDGE_ABNORMAL))
> > + gsi_insert_seq_on_edge (e, n_copies-- > 0 ? gimple_seq_copy (seq) : seq);
> > +}
> > +
> > /* Create and initialize local shadow variables for the lookup cache
> > globals. Put their decls in the *_l globals for use by
> > mf_build_check_statement_for. */
> > Index: mine/gcc/tree-sra.c
> > ===================================================================
> > --- mine.orig/gcc/tree-sra.c
> > +++ mine/gcc/tree-sra.c
> > @@ -236,7 +236,7 @@ is_sra_scalar_type (tree type)
> > instantiated, just that if we decide to break up the type into
> > separate pieces that it can be done. */
> >
> > -bool
> > +static bool
> > sra_type_can_be_decomposed_p (tree type)
> > {
> > unsigned int cache = TYPE_UID (TYPE_MAIN_VARIANT (type)) * 2;
> > @@ -1263,6 +1263,26 @@ build_element_name (struct sra_elt *elt)
> > return XOBFINISH (&sra_obstack, char *);
> > }
> >
> > +/* Insert a gimple_seq SEQ on all the outgoing edges out of BB. Note that
> > + if BB has more than one edge, STMT will be replicated for each edge.
> > + Also, abnormal edges will be ignored. */
> > +
> > +static void
> > +insert_edge_copies_seq (gimple_seq seq, basic_block bb)
> > +{
> > + edge e;
> > + edge_iterator ei;
> > + unsigned n_copies = -1;
> > +
> > + FOR_EACH_EDGE (e, ei, bb->succs)
> > + if (!(e->flags & EDGE_ABNORMAL))
> > + n_copies++;
> > +
> > + FOR_EACH_EDGE (e, ei, bb->succs)
> > + if (!(e->flags & EDGE_ABNORMAL))
> > + gsi_insert_seq_on_edge (e, n_copies-- > 0 ? gimple_seq_copy (seq) : seq);
> > +}
> > +
> > /* Instantiate an element as an independent variable. */
> >
> > static void
> > @@ -2785,29 +2805,9 @@ generate_element_init (struct sra_elt *e
> > return ret;
> > }
> >
> > -/* Insert a gimple_seq SEQ on all the outgoing edges out of BB. Note that
> > - if BB has more than one edge, STMT will be replicated for each edge.
> > - Also, abnormal edges will be ignored. */
> > -
> > -void
> > -insert_edge_copies_seq (gimple_seq seq, basic_block bb)
> > -{
> > - edge e;
> > - edge_iterator ei;
> > - unsigned n_copies = -1;
> > -
> > - FOR_EACH_EDGE (e, ei, bb->succs)
> > - if (!(e->flags & EDGE_ABNORMAL))
> > - n_copies++;
> > -
> > - FOR_EACH_EDGE (e, ei, bb->succs)
> > - if (!(e->flags & EDGE_ABNORMAL))
> > - gsi_insert_seq_on_edge (e, n_copies-- > 0 ? gimple_seq_copy (seq) : seq);
> > -}
> > -
> > /* Helper function to insert LIST before GSI, and set up line number info. */
> >
> > -void
> > +static void
> > sra_insert_before (gimple_stmt_iterator *gsi, gimple_seq seq)
> > {
> > gimple stmt = gsi_stmt (*gsi);
> > @@ -2819,7 +2819,7 @@ sra_insert_before (gimple_stmt_iterator
> >
> > /* Similarly, but insert after GSI. Handles insertion onto edges as well. */
> >
> > -void
> > +static void
> > sra_insert_after (gimple_stmt_iterator *gsi, gimple_seq seq)
> > {
> > gimple stmt = gsi_stmt (*gsi);
> > @@ -3597,7 +3597,7 @@ debug_sra_elt_name (struct sra_elt *elt)
> > fputc ('\n', stderr);
> > }
> >
> > -void
> > +static void
> > sra_init_cache (void)
> > {
> > if (sra_type_decomp_cache)
> >
> >
>
> --
> Richard Guenther <rguenther@suse.de>
> Novell / SUSE Labs
> SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746 - GF: Markus Rex