[llvm-commits] Patch for review: Speeding up ScheduleDAG computations

Roman Levenstein romix.llvm at googlemail.com
Mon Mar 3 09:18:51 PST 2008


Hi Dave,

2008/3/3, David Greene <dag at cray.com>:
> On Friday 29 February 2008 17:49, Evan Cheng wrote:
>  > Let's try to solve one problem at a time.
>  >
>  > 1. Roman's depth / height patch calculation is obviously goodness.
>  > Please commit that first.
>  > 2. It's probably safe to eliminate the "special tie-breaker" from top
>  > down sorting function.
>  > 3. We will need to fix up the sorting functions so strict ordering is
>  > preserved. We need to do so without breaking any of the existing test
>  > case. "return left->NodeNum < right->NodeNum;" doesn't. :-( What does
>  > "return false" mean? Is it favoring nodes that are inserted earlier?
>  > 4. It might be wise to add some debugging code so we can tell where
>  > things start diverge.
>  > 5. It would be nice to be able to rebalance the heap. Roman and David
>  > can fight it out when we get to that point. :-)
>
>
> Sounds good.  I don't know what "fight it out" means, however.  :)
Me either ;)

>  It's more than "nice" to rebalance the heap.  It's necessary if we
>  want to avoid traps when _GLIBCXX_DEBUG is enabled.  And we
>  want to do that because it finds lots of bugs.
Totally agree.

Here is a proposed patch for ScheduleDAGRRList.cpp. It contains the
following changes:
1) Uses std::set instead of the priority queue. This makes removal of
nodes very fast and removes a bottleneck
2) sorting functions use now strict ordering
3) According to your proposal, it takes node priority updates into
account and updates the priority queue by removing and re-inserting
the updated element.
4) SumOfUnscheduledPredsOfSuccs is slightly changed to avoid useless
computations. This saves a LOT OF time on big basic blocks.

Please review and test, if possible. I have problems with running the
llvm-test test-suite. When I to run it (and keep in mind, I never did
it before), I always get the following error messages on my X86/Ubuntu
system:
 make[4]: *** No rule to make target
`Output/sse.expandfft.linked.rbc', needed by
`Output/sse.expandfft.linked.bc'.  Stop.


-Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ScheduleDAGRRList.patch
Type: text/x-diff
Size: 4572 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20080303/bae9ca5c/attachment.patch>


More information about the llvm-commits mailing list