[PATCH] ScheduleDAGInstrs::buildSchedGraph() rewritten.

Jonas Paulsson jonas.paulsson at ericsson.com
Fri Feb 27 04:43:48 PST 2015


Minor fixes, as requested.

Regarding SUList and use of std::list:

I have tried a few options to using std::list for SUList, but unfortunately I cannot find any faster alternative:

- SparseSet: Quite memory expensive, considering that a map of max size MaxS, will in the worst case contain MaxS lists of SUs, each of size one but with the SparseSet::Universe of SUnits.size(). This will certainly also degrade cache performance. Furthermore, this data structure does not guarantee iteration in the order of insertion, after an element has been erased. This is needed to make repeated FIFO order reductions of the list.
- CircularSmallVector: I tried to derive a vector from SmallVector that was reducible in FIFO order without needless re-allocation. The class uses Head and Tail indexes into the vector and instead of erasing elements, a Tail is introduced, which may wrap around after repeated calls to reduce(). It was however marginally slower than std::list.
- SmallVector: Just using a vector was of course very slow, due to all the copying during reductions.

FIFO order reduction should be desireble, as in a region with many unknown stores and loads, it would probably be better to avoid close dependencies rather than between SUs with very different NodeNums (far apart in MBB).
It does not matter in which order the list is iterated over, and indexed access is not needed.

If anyone has a good idea on this, or wants to see my circular vector, let me know. Until then, std::list remains.


http://reviews.llvm.org/D7850

Files:
  include/llvm/CodeGen/ScheduleDAG.h
  include/llvm/CodeGen/ScheduleDAGInstrs.h
  lib/CodeGen/ScheduleDAGInstrs.cpp

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7850.20842.patch
Type: text/x-patch
Size: 32598 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150227/66d669ae/attachment.bin>


More information about the llvm-commits mailing list