[PATCH] D90144: [Scheduling] Fall back to the fast cluster algorithm if the DAG is too complex

Qing Shan Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 26 20:23:51 PDT 2020


steven.zhang updated this revision to Diff 300868.
steven.zhang added a comment.

Address comments.

> Did the concept of using the static DAG not work?

If we want to close the gap with old algorithm, we have to have the O(1) query algorithm, which requires O(M^2) space and some time effort to construct the index. This is a known graph problem and I have no good idea. The scheduling DAG has property that seldom removing the edges but keeping adding edges. Do you have any good idea to improve the IsReachable() which will also benefit the compiling time of scheduler ?

Regarding to the threshold, I did a test with your case by removing the stores to reduce the DAG. This is the data.

  LdSt Num: 794, DAG Size: 1191, 794 x 1191 = 945654 
  new algorithm: 0.53s
  old algorithm: 0.34s

They are completely the same when it is:

  LdSt Num: 669, DAG Size: 1015, 669 x 1015 = 679035 
  new algorithm: 0.39s
  old algorithm: 0.41s

The time complexity for this algorithm is: O(M*(N+E)) if I understand correctly. M is the number of the load/store, and N is the number of the SUnits and E is the number of edges. For now, I choose the 1000000 as threshold as it seems not deg too much.  Is it ok ?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90144/new/

https://reviews.llvm.org/D90144

Files:
  llvm/lib/CodeGen/MachineScheduler.cpp
  llvm/test/CodeGen/AArch64/aarch64-stp-cluster.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90144.300868.patch
Type: text/x-patch
Size: 6420 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201027/41316167/attachment.bin>


More information about the llvm-commits mailing list