mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Duh. That could take a long time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28235 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8f60c56a06
commit
626da3d9ae
@ -170,27 +170,31 @@ void ScheduleDAG::BuildSchedUnits() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CalculateDepths(SUnit *SU, unsigned Depth) {
|
static void CalculateDepths(SUnit *SU, unsigned Depth, unsigned Max) {
|
||||||
if (Depth > SU->Depth) SU->Depth = Depth;
|
if (Depth > SU->Depth) {
|
||||||
for (std::set<std::pair<SUnit*, bool> >::iterator I = SU->Succs.begin(),
|
SU->Depth = Depth;
|
||||||
E = SU->Succs.end(); I != E; ++I)
|
for (std::set<std::pair<SUnit*, bool> >::iterator I = SU->Succs.begin(),
|
||||||
CalculateDepths(I->first, Depth+1);
|
E = SU->Succs.end(); I != E; ++I)
|
||||||
|
CalculateDepths(I->first, Depth+1, Max);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScheduleDAG::CalculateDepths() {
|
void ScheduleDAG::CalculateDepths() {
|
||||||
SUnit *Entry = SUnitMap[DAG.getEntryNode().Val];
|
SUnit *Entry = SUnitMap[DAG.getEntryNode().Val];
|
||||||
::CalculateDepths(Entry, 0U);
|
::CalculateDepths(Entry, 0U, SUnits.size());
|
||||||
for (unsigned i = 0, e = SUnits.size(); i != e; ++i)
|
for (unsigned i = 0, e = SUnits.size(); i != e; ++i)
|
||||||
if (SUnits[i].Preds.size() == 0 && &SUnits[i] != Entry) {
|
if (SUnits[i].Preds.size() == 0 && &SUnits[i] != Entry) {
|
||||||
::CalculateDepths(&SUnits[i], 0U);
|
::CalculateDepths(&SUnits[i], 0U, SUnits.size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CalculateHeights(SUnit *SU, unsigned Height) {
|
static void CalculateHeights(SUnit *SU, unsigned Height) {
|
||||||
if (Height > SU->Height) SU->Height = Height;
|
if (Height > SU->Height) {
|
||||||
for (std::set<std::pair<SUnit*, bool> >::iterator I = SU->Preds.begin(),
|
SU->Height = Height;
|
||||||
E = SU->Preds.end(); I != E; ++I)
|
for (std::set<std::pair<SUnit*, bool> >::iterator I = SU->Preds.begin(),
|
||||||
CalculateHeights(I->first, Height+1);
|
E = SU->Preds.end(); I != E; ++I)
|
||||||
|
CalculateHeights(I->first, Height+1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
void ScheduleDAG::CalculateHeights() {
|
void ScheduleDAG::CalculateHeights() {
|
||||||
SUnit *Root = SUnitMap[DAG.getRoot().Val];
|
SUnit *Root = SUnitMap[DAG.getRoot().Val];
|
||||||
|
Loading…
Reference in New Issue
Block a user