[llvm] r187109 - MI Sched: track register pressure by importance of the set, not weight of the units.
Andrew Trick
atrick at apple.com
Thu Jul 25 00:26:32 PDT 2013
Author: atrick
Date: Thu Jul 25 02:26:32 2013
New Revision: 187109
URL: http://llvm.org/viewvc/llvm-project?rev=187109&view=rev
Log:
MI Sched: track register pressure by importance of the set, not weight of the units.
Modified:
llvm/trunk/lib/CodeGen/RegisterPressure.cpp
Modified: llvm/trunk/lib/CodeGen/RegisterPressure.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterPressure.cpp?rev=187109&r1=187108&r2=187109&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegisterPressure.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegisterPressure.cpp Thu Jul 25 02:26:32 2013
@@ -553,9 +553,10 @@ static void computeExcessPressureDelta(A
else if (Limit > PNew)
PDiff = Limit - POld; // Just obeyed limit.
- if (std::abs(PDiff) > std::abs(ExcessUnits)) {
+ if (PDiff) {
ExcessUnits = PDiff;
PSetID = i;
+ break;
}
}
Delta.Excess.PSetID = PSetID;
@@ -583,23 +584,28 @@ static void computeMaxPressureDelta(Arra
if (PNew == POld) // No change in this set in the common case.
continue;
- while (CritIdx != CritEnd && CriticalPSets[CritIdx].PSetID < i)
- ++CritIdx;
-
- if (CritIdx != CritEnd && CriticalPSets[CritIdx].PSetID == i) {
- int PDiff = (int)PNew - (int)CriticalPSets[CritIdx].UnitIncrease;
- if (PDiff > Delta.CriticalMax.UnitIncrease) {
- Delta.CriticalMax.PSetID = i;
- Delta.CriticalMax.UnitIncrease = PDiff;
+ if (!Delta.CriticalMax.isValid()) {
+ while (CritIdx != CritEnd && CriticalPSets[CritIdx].PSetID < i)
+ ++CritIdx;
+
+ if (CritIdx != CritEnd && CriticalPSets[CritIdx].PSetID == i) {
+ int PDiff = (int)PNew - (int)CriticalPSets[CritIdx].UnitIncrease;
+ if (PDiff > 0) {
+ Delta.CriticalMax.PSetID = i;
+ Delta.CriticalMax.UnitIncrease = PDiff;
+ }
}
}
-
- // Find the greatest increase above MaxPressureLimit.
+ // Find the first increase above MaxPressureLimit.
// (Ignores negative MDiff).
- int MDiff = (int)PNew - (int)MaxPressureLimit[i];
- if (MDiff > Delta.CurrentMax.UnitIncrease) {
- Delta.CurrentMax.PSetID = i;
- Delta.CurrentMax.UnitIncrease = MDiff;
+ if (!Delta.CurrentMax.isValid()) {
+ int MDiff = (int)PNew - (int)MaxPressureLimit[i];
+ if (MDiff > 0) {
+ Delta.CurrentMax.PSetID = i;
+ Delta.CurrentMax.UnitIncrease = MDiff;
+ if (CritIdx == CritEnd || Delta.CriticalMax.isValid())
+ break;
+ }
}
}
}
More information about the llvm-commits
mailing list