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]

Re: [patches] Re: basics of flow based jump pass


> On Thu, Jun 28, 2001 at 12:18:32AM +0200, Jan Hubicka wrote:
> > +   /* Fixup barriers.  */
> > +   barrier = next_nonnote_insn (insn);
> > +   if (fallthru && GET_CODE (barrier) == BARRIER)
> > +     flow_delete_insn (barrier), barrier = insn;
> > +   else if (!fallthru && GET_CODE (barrier) != BARRIER)
> > +     barrier = emit_barrier_after (insn);
> 
> No need to set barrier at the end of this sequence.
I think I need to do so.
Imagine that I want to redirect fallthru edge of the conditional jump
to it's destination.  I need barrier after the new unconditional jump.
(well, one of effects of killing jump would be to kill barriers)
> 
> > ! static int
> > ! try_simplify_condjump (src)
> > !      basic_block src;
> > ! {
> > !   basic_block final_block, next_block;
> > !   rtx insn = src->end;
> > !   edge branch, fallthru;
> >   
> > !   if (!any_condjump_p (insn))
> > !     return 0;
> > ! 
> > !   fallthru = src->succ;
> > !   if (!(fallthru->flags & EDGE_FALLTHRU))
> > !     branch = fallthru->succ_next;
> 
> Initialization of branch and fallthru is incomplete.  There is
> no inherent ordering of the edges in the list.
Opps.  It should be fallthru =.
Whats about introducing macros FALLTHRU_EDGE (bb) and BRANCH_EDGE (bb)?
> Surely this last assignment is supposed to be "b = c"?
Sure.
> Split this whole loop out into its own function.  Also,
> I don't think you want to process abnormal edges.
I think I want to.  In future I would like to make redirect_edge to
handle special cases of these.
For instance edge of computed jump to the label can be redirected simply
by moving the label in question and fixing rest, in case no other unredirectable
edge is not present.

I am not doing that at the moment, but it seems to be important, as abnomral
edges keeps considerable garbage.
> 
> > ! 	      while (is_forwarder_block_p (target)
> > ! 		     && target->succ->dest != EXIT_BLOCK_PTR
> > ! 		     && counter < n_basic_blocks)
> 
> I think it would be a Good Thing to detect the trivial case
> of "while (1) continue;" without traversing all blocks.
I think proper way can be to drop flag on the basic block "inside infinite loop"
so next time we won't stop.

I will handle the simple uncondotional loop as well first.

Honza
> 
> 
> 
> r~


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