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: [tree-ssa]: Generic link routines and some insert infrastructure


On Fri, 2003-03-07 at 16:45, Diego Novillo wrote:
> On Wed, 2003-03-05 at 15:18, Andrew MacLeod wrote:
> 
> > So, is this OK, or are there a few things we'd like to change? :-)
> > 
> I think it's a great start.  I guess Dan would be the only one able to
> test them right now with PRE.  In any case, if you think that they are
> good enough, go ahead and commit the code.  It's your turf after all :)
> 

Good enough for the moment anyway. I've checked them in. Now Im trying
to get the insert_before/after/on_edge routines ready. tricky business
that. This week for sure. yeesh.

I did notice a place in tree-ssa.c which calls bsi_remove_stmt (). That
interface has changed since bsi_remove updates the iterator now. The
code is in rewrite_stmt(), and its currently commented out:

#if 0
          register_new_def (*def_p, cached_lhs, block_defs_p);
          ssa_stats.num_re++;
          bsi_remove (si);
          return;
#else
          if (var_is_live (cached_lhs, ann->bb))
            {
              register_new_def (*def_p, cached_lhs, block_defs_p);
              TREE_OPERAND (stmt, 1) = cached_lhs;
              ann->modified = 1;
              ssa_stats.num_re++;
            }
          else
            ssa_stats.blocked_optimizations++;
#endif

And this in turn is in a loop which calls rewrite_stmt ():

/* Step 2.  Rewrite every variable used in each statement the block with
     its immediate reaching definitions.  Update the current definition of
     a variable when a new real or virtual definition is found.  */
  for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
    rewrite_stmt (si, &block_defs, &block_avail_exprs);

This'll probably have to be re-written such that rewrite_stmt returns a
true if it updated the iterator, and then the loop will look something
like:

for (si = bsi_start (bb); !bsi_end_p (si); )
  if (!rewrite_stmt (&si, &block_defs, &block_avail_exprs))
    bsi_next (si):

I can take care of this in the next round if you want. I have another
round of infrastructure for BB and bsi_ manipulations.

Andrew


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