Skip to content

Commit

Permalink
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
26 changes: 26 additions & 0 deletions src/coreclr/jit/lsra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10955,6 +10955,22 @@ void LinearScan::verifyFinalAllocation()
}
if (regNum == REG_NA)
{
// If this interval is still assigned to a register
if (interval->physReg != REG_NA)
{
// then unassign it if no new register was assigned to the RefTypeDef
if (RefTypeIsDef(currentRefPosition->refType))
{
assert(interval->assignedReg != nullptr);
if (interval->assignedReg->assignedInterval == interval)
{
interval->assignedReg->assignedInterval = nullptr;
}
interval->physReg = REG_NA;
interval->assignedReg = nullptr;
}
}

dumpLsraAllocationEvent(LSRA_EVENT_NO_REG_ALLOCATED, interval);
}
else if (RefTypeIsDef(currentRefPosition->refType))
Expand Down Expand Up @@ -11093,6 +11109,16 @@ void LinearScan::verifyFinalAllocation()
{
assert(!currentRefPosition->spillAfter || currentRefPosition->IsActualRef());

if (RefTypeIsDef(currentRefPosition->refType))
{
// If an interval got assigned to a different register (while the different
// register got spilled), then clear the assigned interval of current register.
if (interval->physReg != REG_NA && interval->physReg != regNum)
{
interval->assignedReg->assignedInterval = nullptr;
}
}

interval->physReg = REG_NA;
interval->assignedReg = nullptr;

Expand Down
3 changes: 0 additions & 3 deletions src/coreclr/jit/lsra.h
Original file line number Diff line number Diff line change
Expand Up @@ -510,9 +510,6 @@ class RegRecord : public Referenceable
void tinyDump();
#endif // DEBUG

// RefPosition * getNextRefPosition();
// LsraLocation getNextRefLocation();

// DATA

// interval to which this register is currently allocated.
Expand Down

0 comments on commit 3fc3a22

Please sign in to comment.