Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AIE NFC] Postpipeliner cleanups and refactorings #253

Open
wants to merge 9 commits into
base: aie-public
Choose a base branch
from
14 changes: 11 additions & 3 deletions llvm/lib/Target/AIE/AIEPostPipeliner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,10 @@ bool PostPipeliner::computeLoopCarriedParameters() {
N.StaticLatest = N.Latest;
}
Info.compute();
return true;

// If no node can be scheduled in cycle 0, we must have a circuit that
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: If no node can be scheduled in cycle 0 after accounting for LCDs, ...

// is longer than II
return Info.MinEarliest == 0;
}

int PostPipeliner::computeMinScheduleLength() const {
Expand Down Expand Up @@ -753,7 +756,7 @@ bool PostPipeliner::schedule(ScheduleDAGMI &TheDAG, int InitiationInterval) {
assert(NTotalInstrs % NInstr == 0);
NCopies = NTotalInstrs / NInstr;
if (NCopies == 1) {
LLVM_DEBUG(dbgs() << "PostPipeliner: Not feasible\n");
LLVM_DEBUG(dbgs() << "PostPipeliner: Not feasible - Too few stages\n");
return false;
}
II = InitiationInterval;
Expand All @@ -770,7 +773,12 @@ bool PostPipeliner::schedule(ScheduleDAGMI &TheDAG, int InitiationInterval) {
I++) { dbgs() << I << " " << *DAG->SUnits[I].getInstr(); });
LLVM_DEBUG(dumpGraph(Info, DAG));

computeLoopCarriedParameters();
bool Feasible = computeLoopCarriedParameters();
if (!Feasible) {
LLVM_DEBUG(dbgs() << "PostPipeliner: Not feasible - RecMII\n");
return false;
}

LLVM_DEBUG(dumpIntervals(Info, computeMinScheduleLength()));
if (!tryHeuristics()) {
LLVM_DEBUG(dbgs() << "PostPipeliner: No schedule found\n");
Expand Down