From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dale Johannesen To: gcc@gcc.gnu.org Subject: more complicated scheduler question Date: Mon, 15 Oct 2001 15:15:00 -0000 Message-id: <18E4BAD7-C1BA-11D5-9FC9-003065C86F94@apple.com> X-SW-Source: 2001-10/msg00883.html 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.