[PATCH] D60125: [ScheduleDAGRRList] Recompute topological ordering on demand.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 2 06:25:27 PDT 2019


fhahn created this revision.
fhahn added reviewers: MatzeB, atrick, efriedma, niravd, paquette.
Herald added subscribers: jdoerfert, hiraditya.
Herald added a project: LLVM.

Currently there is a single point in ScheduleDAGRRList, where we
actually query the topological order (besides init code). Currently we
are recomputing the order after adding a node (which does not have
predecessors) and then we add predecessors edge-by-edge.

We can avoid adding edges one-by-one after we added a new node. In that case, we can
just rebuild the order from scratch after adding the edges to the DAG
and avoid all the updates to the ordering.

Also, we can delay updating the DAG until we query the DAG, if we keep a
list of added edges. Depending on the number of updates, we can either
apply them when needed or recompute the order from scratch.

This brings down the geomean compile time for of CTMark with -O1 down 0.2% on X86,
with no regressions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D60125

Files:
  llvm/include/llvm/CodeGen/ScheduleDAG.h
  llvm/lib/CodeGen/ScheduleDAG.cpp
  llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60125.193275.patch
Type: text/x-patch
Size: 9998 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190402/18a2a241/attachment.bin>


More information about the llvm-commits mailing list