[PATCH] ScheduleDAGInstrs::buildSchedGraph() rewritten.

hfinkel at anl.gov hfinkel at anl.gov
Tue Feb 24 16:12:19 PST 2015


Wow! This sounds like really great progress.


================
Comment at: include/llvm/CodeGen/ScheduleDAGInstrs.h:78
@@ +77,3 @@
+  typedef SmallVector<PointerIntPair<ValueType, 1, bool>, 4>
+  UnderlyingObjectsVector;
+
----------------
Indent?

================
Comment at: include/llvm/CodeGen/ScheduleDAGInstrs.h:83
@@ -76,2 +82,3 @@
   class ScheduleDAGInstrs : public ScheduleDAG {
+
   protected:
----------------
Don't add a blank line here.

================
Comment at: include/llvm/CodeGen/ScheduleDAGInstrs.h:148
@@ +147,3 @@
+    // A list of SUnits, used in Value2SUsMap, during DAG construction.
+    class SUList : public std::list<SUnit *> {
+      // This SUnit reaches all nodes that has gotten pruned from this
----------------
There may be a better option compared to deriving this from std::list; for one thing, std::list tends to have terrible cache locality.

Given that the SUs are numbered, and we're limiting the depth to something in the 100s, would using a SparseSet be better (from llvm/ADT/SparseSet.h)? it has constant time clear, ordered vector-speed iteration, and constant-time find/insert/erase.


================
Comment at: include/llvm/CodeGen/ScheduleDAGInstrs.h:262
@@ +261,3 @@
+      if (Itr != Val2SUsMap.end())
+        addChainDependencies(SU, Itr->second, Val2SUsMap.getTrueMemOrderLatency());
+    }
----------------
Line too long.

================
Comment at: include/llvm/CodeGen/ScheduleDAGInstrs.h:267
@@ +266,3 @@
+    // clear the list. Called from addBarrierChainsAndClearMap().
+    void addBarrierChains(SUnit *BarrierSU, SUList &sulist) {
+      for (auto *su : sulist)
----------------
SUList &sulist -> SUList &SL
(or something like that)

================
Comment at: include/llvm/CodeGen/ScheduleDAGInstrs.h:288
@@ -142,1 +287,3 @@
+    // For an unanalyzable memory access, this Value is used in maps.
+    UndefValue *unknownValue;
 
----------------
unknownValue -> UnknownValue

================
Comment at: lib/CodeGen/ScheduleDAGInstrs.cpp:116
@@ +115,3 @@
+  for (unsigned i = 0; i < lists.size();) {
+    // Don't reduce lists smaller than this.
+    if (lists[i]->size() == 0)
----------------
Smaller than 0?

================
Comment at: lib/CodeGen/ScheduleDAGInstrs.cpp:144
@@ +143,3 @@
+      CanHandleTerminators(false), AAForDep(nullptr),
+      unknownValue(UndefValue::get(Type::getVoidTy(mf.getFunction()->getContext()))),
+      FirstDbgValue(nullptr) {
----------------
Line too long.

http://reviews.llvm.org/D7850

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list