On Thu, 17 Feb 2022, Jan Hubicka wrote:

> > +/* Returns whether the control parents of BB are preserved.  */
> > +
> > +static bool
> > +control_parents_preserved_p (basic_block bb)
> > +{
> > +  /* If we marked the control parents from BB they are preserved.  */
> > +  if (bitmap_bit_p (visited_control_parents, bb->index))
> > +    return true;
> > +
> > +  /* But they can also end up being marked from elsewhere.  */
> > +  bitmap_iterator bi;
> > +  unsigned edge_number;
> > +  EXECUTE_IF_SET_IN_BITMAP (cd->get_edges_dependent_on (bb->index),
> > +                       0, edge_number, bi)
> > +    {
> > +      basic_block cd_bb = cd->get_edge_src (edge_number);
> > +      if (cd_bb != bb
> > +     && !bitmap_bit_p (last_stmt_necessary, cd_bb->index))
> > +   return false;
> > +    }
> > +  return true;
> I suppose you can also set visited_control_parents bit here so the loop
> is not re-done for every clobber in a BB.

Good idea, will do that.

Richard.

Reply via email to