diff options
author | Kunal Pathak <Kunal.Pathak@microsoft.com> | 2021-07-08 03:51:52 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-08 03:51:52 +0300 |
commit | 7f88911fe5f89836d1de7efd23f8541514a5ed05 (patch) | |
tree | c65d5ab25854d17db33a05988e36a2a4a7f10d70 /src/coreclr/jit | |
parent | 893739ffe77df0eb927d3755e08647597dae32a6 (diff) |
Use correct assignedInterval for SPILL_COST calculation (#55247)
Diffstat (limited to 'src/coreclr/jit')
-rw-r--r-- | src/coreclr/jit/lsra.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/coreclr/jit/lsra.cpp b/src/coreclr/jit/lsra.cpp index a2bb138ad0c..ecd4dbd9e46 100644 --- a/src/coreclr/jit/lsra.cpp +++ b/src/coreclr/jit/lsra.cpp @@ -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. |