[llvm-commits] Patch for review: Speeding-up isReachable computation, fix for Bugzilla #1835
romix.llvm at googlemail.com
Tue Mar 18 11:20:56 CDT 2008
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:
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
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 16781 bytes
Desc: not available
Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080318/50ed7bc0/attachment.bin
More information about the llvm-commits