Skip to content

Commit

Permalink
Use correct assignedInterval for SPILL_COST calculation (#55247)
Browse files Browse the repository at this point in the history
  • Loading branch information
kunalspathak authored Jul 8, 2021
1 parent 893739f commit 7f88911
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/coreclr/jit/lsra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11264,8 +11264,8 @@ void LinearScan::RegisterSelection::try_SPILL_COST()
RefPosition* recentRefPosition = spillCandidateRegRecord->assignedInterval != nullptr
? spillCandidateRegRecord->assignedInterval->recentRefPosition
: nullptr;
if ((recentRefPosition != nullptr) && (recentRefPosition->RegOptional()) &&
!(currentInterval->isLocalVar && recentRefPosition->IsActualRef()))
if ((recentRefPosition != nullptr) && (recentRefPosition->RegOptional() &&
!(spillCandidateRegRecord->assignedInterval->isLocalVar && recentRefPosition->IsActualRef())))
{
// We do not "spillAfter" if previous (recent) refPosition was regOptional or if it
// is not an actual ref. In those cases, we will reload in future (next) refPosition.
Expand Down

0 comments on commit 7f88911

Please sign in to comment.