This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Using cfglayout mode in the selective scheduler
- From: "Steven Bosscher" <stevenb dot gcc at gmail dot com>
- To: "Andrey Belevantsev" <abel at ispras dot ru>
- Cc: "GCC mailing list" <gcc at gcc dot gnu dot org>, "Zdenek Dvorak" <rakdver at kam dot mff dot cuni dot cz>
- Date: Mon, 11 Aug 2008 21:27:08 +0200
- Subject: Re: Using cfglayout mode in the selective scheduler
- References: <48A044E5.1050503@ispras.ru>
On Mon, Aug 11, 2008 at 3:55 PM, Andrey Belevantsev <abel@ispras.ru> 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