@@ -11247,11 +11247,12 @@ void LinearScan::RegisterSelection::try_SPILL_COST()
11247
11247
spillCandidates &= ~spillCandidateBit;
11248
11248
regNumber spillCandidateRegNum = genRegNumFromMask (spillCandidateBit);
11249
11249
RegRecord* spillCandidateRegRecord = &linearScan->physRegs [spillCandidateRegNum];
11250
+ Interval* assignedInterval = spillCandidateRegRecord->assignedInterval ;
11250
11251
11251
11252
// Can and should the interval in this register be spilled for this one,
11252
11253
// if we don't find a better alternative?
11253
11254
if ((linearScan->getNextIntervalRef (spillCandidateRegNum, regType) == currentLocation) &&
11254
- !spillCandidateRegRecord-> assignedInterval ->getNextRefPosition ()->RegOptional ())
11255
+ !assignedInterval->getNextRefPosition ()->RegOptional ())
11255
11256
{
11256
11257
continue ;
11257
11258
}
@@ -11261,17 +11262,15 @@ void LinearScan::RegisterSelection::try_SPILL_COST()
11261
11262
}
11262
11263
11263
11264
float currentSpillWeight = 0 ;
11264
- RefPosition* recentRefPosition = spillCandidateRegRecord->assignedInterval != nullptr
11265
- ? spillCandidateRegRecord->assignedInterval ->recentRefPosition
11266
- : nullptr ;
11267
- if ((recentRefPosition != nullptr ) && (recentRefPosition->RegOptional () &&
11268
- !(spillCandidateRegRecord->assignedInterval ->isLocalVar && recentRefPosition->IsActualRef ())))
11265
+ RefPosition* recentRefPosition = assignedInterval != nullptr ? assignedInterval->recentRefPosition : nullptr ;
11266
+ if ((recentRefPosition != nullptr ) &&
11267
+ (recentRefPosition->RegOptional () && !(assignedInterval->isLocalVar && recentRefPosition->IsActualRef ())))
11269
11268
{
11270
11269
// We do not "spillAfter" if previous (recent) refPosition was regOptional or if it
11271
11270
// is not an actual ref. In those cases, we will reload in future (next) refPosition.
11272
11271
// For such cases, consider the spill cost of next refposition.
11273
11272
// See notes in "spillInterval()".
11274
- RefPosition* reloadRefPosition = spillCandidateRegRecord-> assignedInterval ->getNextRefPosition ();
11273
+ RefPosition* reloadRefPosition = assignedInterval->getNextRefPosition ();
11275
11274
if (reloadRefPosition != nullptr )
11276
11275
{
11277
11276
currentSpillWeight = linearScan->getWeight (reloadRefPosition);
0 commit comments