mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-28 19:25:00 +00:00
MI Sched: track register pressure by importance of the set, not weight of the units.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187109 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -553,9 +553,10 @@ static void computeExcessPressureDelta(ArrayRef<unsigned> OldPressureVec,
|
|||||||
else if (Limit > PNew)
|
else if (Limit > PNew)
|
||||||
PDiff = Limit - POld; // Just obeyed limit.
|
PDiff = Limit - POld; // Just obeyed limit.
|
||||||
|
|
||||||
if (std::abs(PDiff) > std::abs(ExcessUnits)) {
|
if (PDiff) {
|
||||||
ExcessUnits = PDiff;
|
ExcessUnits = PDiff;
|
||||||
PSetID = i;
|
PSetID = i;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Delta.Excess.PSetID = PSetID;
|
Delta.Excess.PSetID = PSetID;
|
||||||
@@ -583,23 +584,28 @@ static void computeMaxPressureDelta(ArrayRef<unsigned> OldMaxPressureVec,
|
|||||||
if (PNew == POld) // No change in this set in the common case.
|
if (PNew == POld) // No change in this set in the common case.
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
while (CritIdx != CritEnd && CriticalPSets[CritIdx].PSetID < i)
|
if (!Delta.CriticalMax.isValid()) {
|
||||||
++CritIdx;
|
while (CritIdx != CritEnd && CriticalPSets[CritIdx].PSetID < i)
|
||||||
|
++CritIdx;
|
||||||
|
|
||||||
if (CritIdx != CritEnd && CriticalPSets[CritIdx].PSetID == i) {
|
if (CritIdx != CritEnd && CriticalPSets[CritIdx].PSetID == i) {
|
||||||
int PDiff = (int)PNew - (int)CriticalPSets[CritIdx].UnitIncrease;
|
int PDiff = (int)PNew - (int)CriticalPSets[CritIdx].UnitIncrease;
|
||||||
if (PDiff > Delta.CriticalMax.UnitIncrease) {
|
if (PDiff > 0) {
|
||||||
Delta.CriticalMax.PSetID = i;
|
Delta.CriticalMax.PSetID = i;
|
||||||
Delta.CriticalMax.UnitIncrease = PDiff;
|
Delta.CriticalMax.UnitIncrease = PDiff;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Find the first increase above MaxPressureLimit.
|
||||||
// Find the greatest increase above MaxPressureLimit.
|
|
||||||
// (Ignores negative MDiff).
|
// (Ignores negative MDiff).
|
||||||
int MDiff = (int)PNew - (int)MaxPressureLimit[i];
|
if (!Delta.CurrentMax.isValid()) {
|
||||||
if (MDiff > Delta.CurrentMax.UnitIncrease) {
|
int MDiff = (int)PNew - (int)MaxPressureLimit[i];
|
||||||
Delta.CurrentMax.PSetID = i;
|
if (MDiff > 0) {
|
||||||
Delta.CurrentMax.UnitIncrease = MDiff;
|
Delta.CurrentMax.PSetID = i;
|
||||||
|
Delta.CurrentMax.UnitIncrease = MDiff;
|
||||||
|
if (CritIdx == CritEnd || Delta.CriticalMax.isValid())
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user