mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-11-03 14:21:30 +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;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (!Delta.CriticalMax.isValid()) {
 | 
				
			||||||
      while (CritIdx != CritEnd && CriticalPSets[CritIdx].PSetID < i)
 | 
					      while (CritIdx != CritEnd && CriticalPSets[CritIdx].PSetID < i)
 | 
				
			||||||
        ++CritIdx;
 | 
					        ++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 greatest increase above MaxPressureLimit.
 | 
					    // Find the first increase above MaxPressureLimit.
 | 
				
			||||||
    // (Ignores negative MDiff).
 | 
					    // (Ignores negative MDiff).
 | 
				
			||||||
 | 
					    if (!Delta.CurrentMax.isValid()) {
 | 
				
			||||||
      int MDiff = (int)PNew - (int)MaxPressureLimit[i];
 | 
					      int MDiff = (int)PNew - (int)MaxPressureLimit[i];
 | 
				
			||||||
    if (MDiff > Delta.CurrentMax.UnitIncrease) {
 | 
					      if (MDiff > 0) {
 | 
				
			||||||
        Delta.CurrentMax.PSetID = i;
 | 
					        Delta.CurrentMax.PSetID = i;
 | 
				
			||||||
        Delta.CurrentMax.UnitIncrease = MDiff;
 | 
					        Delta.CurrentMax.UnitIncrease = MDiff;
 | 
				
			||||||
 | 
					        if (CritIdx == CritEnd || Delta.CriticalMax.isValid())
 | 
				
			||||||
 | 
					          break;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user