@@ -547,6 +547,8 @@ int PostPipeliner::computeMinScheduleLength() const {
547547 return MinLength;
548548}
549549
550+ namespace {
551+
550552void dumpGraph (const ScheduleInfo &Info, ScheduleDAGInstrs *DAG) {
551553 dbgs () << " digraph {\n " ;
552554
@@ -604,17 +606,31 @@ void dumpGraph(const ScheduleInfo &Info, ScheduleDAGInstrs *DAG) {
604606 dbgs () << " }\n " ;
605607}
606608
609+ char slotLetter (const SlotCounts &Slots) {
610+ // Slots are sorted by name in tablegen.
611+ // alu, lda, ldb, lng, mov, nop, st, vec
612+ const char *const L = " XABLMNSVW9" ;
613+
614+ for (int I = 0 ; I < 10 ; I++) {
615+ if (Slots[I] > 0 ) {
616+ return L[I];
617+ }
618+ }
619+ return ' *' ;
620+ }
621+
607622void dumpSchedule (const ScheduleInfo &Info, int MinLength, int II,
608623 std::function<bool (int I, int K)> Select) {
609624 for (int K = 0 ; K < Info.NInstr ; K++) {
625+ char S = slotLetter (Info[K].Slots );
610626 std::string Head = " SU" + std::to_string (K);
611627 dbgs () << Head;
612628 for (int I = Head.length () - 6 ; I < MinLength; I++) {
613629 if (I >= 0 && I % II == 0 ) {
614630 dbgs () << " |" ;
615631 }
616632 if (Select (I, K)) {
617- dbgs () << " * " ;
633+ dbgs () << S ;
618634 } else {
619635 dbgs () << " " ;
620636 }
@@ -640,6 +656,7 @@ void dumpCycles(const ScheduleInfo &Info, int II) {
640656 dumpSchedule (Info, FullStageLength, II,
641657 [&](int I, int K) { return I == Info[K].Cycle ; });
642658}
659+ } // namespace
643660
644661int PostPipeliner::mostUrgent (PostPipelinerStrategy &Strategy) {
645662 assert (FirstUnscheduled <= LastUnscheduled);
@@ -831,6 +848,7 @@ bool PostPipeliner::scheduleWithStrategy(PostPipelinerStrategy &S) {
831848 return true ;
832849}
833850
851+ namespace {
834852int getMinOutputLat (ArrayRef<SDep> Edges) {
835853 int Min = std::numeric_limits<int >::max ();
836854 for (const SDep &Dep : Edges) {
@@ -840,6 +858,7 @@ int getMinOutputLat(ArrayRef<SDep> Edges) {
840858 }
841859 return Min;
842860}
861+ } // namespace
843862
844863class DefaultStrategy : public PostPipelinerStrategy {
845864public:
0 commit comments