Skip to content

Commit e25c678

Browse files
Martien de Jongmartien-de-jong
authored andcommitted
[AIE][NFC] Add slot indicator in schedule dump
1 parent f5990cf commit e25c678

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

llvm/lib/Target/AIE/AIEPostPipeliner.cpp

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,8 @@ int PostPipeliner::computeMinScheduleLength() const {
547547
return MinLength;
548548
}
549549

550+
namespace {
551+
550552
void 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+
607622
void 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

644661
int PostPipeliner::mostUrgent(PostPipelinerStrategy &Strategy) {
645662
assert(FirstUnscheduled <= LastUnscheduled);
@@ -831,6 +848,7 @@ bool PostPipeliner::scheduleWithStrategy(PostPipelinerStrategy &S) {
831848
return true;
832849
}
833850

851+
namespace {
834852
int 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

844863
class DefaultStrategy : public PostPipelinerStrategy {
845864
public:

0 commit comments

Comments
 (0)