This is the mail archive of the gcc@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]

more complicated scheduler question


I have a block that looks like this:

...
x = y/z;
a = b/c;
...

and so on, with 20 or so FP divides, and none of the memory references
dependent.  On a machine with a single FP divide unit, it's obvious to
a human that the speed of this block is going to depend on how fast
you can do those divides; you want to start doing them as soon as
possible.  The Haifa scheduling algorithm doesn't do that.  All the
loads get the same, high priority, higher than that of the divides,
so it will schedule all the loads ahead of all the divides if
resources permit.  Basically the "critical path" algorithm has problems
when there are multiple, parallel critical paths.  The real "critical
path" here is keeping the FP unit occupied, but the scheduler never
figures that out.

I've tried a number of things to fix this, and have something that seems
to improve the behavior overall on the target and benchmarks I'm
interested in.  But this is neither general nor elegant, nor a win in
all cases for that matter, and anyway it seems to me the problem is more
generic than target-dependent.  So I thought I'd see if anyone here had
a suggestion; I know people have worked on this scheduler longer than
I have.


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