[PATCH] D31587: MachineScheduler/ScheduleDAG: Add support for getSUTopoIndex

Axel Davy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 3 14:05:34 PDT 2017


axeldavy updated this revision to Diff 93943.
axeldavy retitled this revision from "MachineScheduler/ScheduleDAG: Add support for getNode2Index" to "MachineScheduler/ScheduleDAG: Add support for getSUTopoIndex".
axeldavy edited the summary of this revision.
axeldavy added a comment.

Replaced getNode2Index by getSUTopoIndex, and completed documentation.


Repository:
  rL LLVM

https://reviews.llvm.org/D31587

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


Index: lib/CodeGen/ScheduleDAG.cpp
===================================================================
--- lib/CodeGen/ScheduleDAG.cpp
+++ lib/CodeGen/ScheduleDAG.cpp
@@ -682,6 +682,12 @@
   return HasLoop;
 }
 
+int ScheduleDAGTopologicalSort::getNodeTopoIndex(SUnit &SU)
+{
+  assert(!SU.isBoundaryNode());
+  return Node2Index[SU.NodeNum];
+}
+
 void ScheduleDAGTopologicalSort::Allocate(int n, int index) {
   Node2Index[n] = index;
   Index2Node[index] = n;
Index: include/llvm/CodeGen/ScheduleDAG.h
===================================================================
--- include/llvm/CodeGen/ScheduleDAG.h
+++ include/llvm/CodeGen/ScheduleDAG.h
@@ -738,6 +738,11 @@
     /// current node \p M.
     void RemovePred(SUnit *M, SUnit *N);
 
+    /// Maps SUnits to indexes of a topological ordering.
+    /// The index is between 0 and SUnits.count()-1.
+    /// Boundary SUnits are not mapped.
+    int getSUTopoIndex(SUnit &SU);
+
     typedef std::vector<int>::iterator iterator;
     typedef std::vector<int>::const_iterator const_iterator;
     iterator begin() { return Index2Node.begin(); }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31587.93943.patch
Type: text/x-patch
Size: 1101 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170403/b199936d/attachment.bin>


More information about the llvm-commits mailing list