This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Question about first scheduling pass
- From: Ian Lance Taylor <iant at google dot com>
- To: Bradley Lucier <lucier at math dot purdue dot edu>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Mon, 09 Nov 2009 22:17:19 -0800
- Subject: Re: Question about first scheduling pass
- References: <1257823593.16278.66.camel@heine.math.purdue.edu>
Bradley Lucier <lucier@math.purdue.edu> writes:
> So, pre-register-allocation takes about 1/2 the CPU time of the entire
> compile.
I believe you, but I find that surprising.
> I've been trying to figure out why the first scheduling pass takes so
> much longer than the second.
It's presumably because the first scheduling pass is done before
register allocation, and therefore has much more flexibility in
rearranging instructions. The second scheduling pass is done after
register allocation, which means that it can't rearrange instructions
that use the same register, even the instructions use them for
different values. So the second scheduling pass has much less
freedom.
> What I'd like to know is whether there's a way to modify the first
> scheduling pass to be more like the second and then see whether I get
> similar speedups to what I'm getting now.
I don't know.
> As a hack, could I just change
>
> NEXT_PASS (pass_sched);
>
> in passes.c to
>
> NEXT_PASS (pass_sched2);
No.
> Or should I change the definitions of pass_sched and pass_sched2 in
> sched-rgn.c?
You would have to change the code itself.
> Also, there are a number of sched*.c files; are there types of
> scheduling other than basic-block scheduling and inter-block scheduling
> that I could try?
There is -fselective-scheduling and -fselective-scheduling2.
Ian