[llvm-commits] Patch for review: Speeding-up isReachable computation, fix for Bugzilla #1835

Roman Levenstein romix.llvm at googlemail.com
Tue Mar 18 09:20:56 PDT 2008


Hi,

I've implemented some improvements related to the computation of isReachable.
As reported by me in Bugzilla #1835
(http://llvm.org/bugs/show_bug.cgi?id=1835), this function may consume
99% of compilation time on very big scheduler DAGs.

The reason for this bad performance is that current algorithm is very
naive and scans all nodes of the DAG in the worst case.

I implemented a better algorithm based on the paper "Online algorithms
for maintaining the topological order of a directed acyclic graph" by
David J.Pearce and Paul H.J.Kelly. This is the MNR algorithm. It has a
linear time worst-case and performs much better in most situations.

The paper can be found here:
http://fano.ics.uci.edu/cites/Document/Online-algorithms-for-maintaining-the-topological-order-of-a-directed-acyclic-graph.html

I tested the new algorithm comparing it with the old one side-by-side
and they seem to produce the same results.

Tests on very big  input files with tens of thousands of instructions
in a BB, e.g. big4.bc use-case from Duraid's testsuit, indicate huge
speed-ups (up to 10x compilation time improvement) compared to the
current version.

The performance of BURR scheduler seems to be now similar to TDRR
scheduler even on the corner-cases mentioned in the Bugzilla. So, I'd
consider it to be a proper fix.

No new regressions are introduced into the llvm/test.

Please review, test and tell if it is OK for submission.

- Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ScheduleDAGRRList.isReachable.patch
Type: text/x-patch
Size: 16782 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20080318/50ed7bc0/attachment.bin>


More information about the llvm-commits mailing list