On Mon, Aug 11, 2008 at 3:55 PM, Andrey Belevantsev <[EMAIL PROTECTED]> wrote:
> 1. Make the required fixes inside the cfglayout hooks so that both the new
> behavior and the old behavior is supported and the user can choose one of
> them.  As we still need to see the created jumps, we need to make
> try_redirect_by_replacing_jump and force_nonfallthru functions either to
> call user-defined hooks on the new jumps or to record the new jumps in a
> vector to which the user can get access.
>
> 2. Factor out the hooks and helpers from cfg*.c into smaller functions and
> create the alternative implementations of hooks inside the scheduler, which
> will see the new jumps.  The old behavior will be retained as we'll not
> change the original hooks.
>
> 3. Modify try_redirect_by_replacing_jump and force_nonfallthru as in #1, but
> do this in cfgrtl mode.  No changes to the cfglayout mode will be needed
> then, and it will not be used at all.

I prefer a mix of #2 and #1.  I think much of the code in
cfglayout.c:fixup_reorder_chain() could itself be made to work in
cfglayout mode.  You could modify the code to insert jumps where
necessary before actually joining the basic blocks/headers/footers to
a chain again. And you could create predicates that say yes/no on the
question "do I need to end this basic block (in cfglayout mode) with a
jump or not?"

Gr.
Steven

Reply via email to