Skip to content

Commit 0f86c45

Browse files
authored
Free the second half of double register (#46939)
* free the second half of double register * Take appropriate regmask * revert part of comment
1 parent bb4f407 commit 0f86c45

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/coreclr/jit/lsra.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4934,6 +4934,20 @@ void LinearScan::processBlockStartLocations(BasicBlock* currentBlock)
49344934
unassignIntervalBlockStart(getSecondHalfRegRec(targetRegRecord),
49354935
allocationPassComplete ? nullptr : inVarToRegMap);
49364936
}
4937+
4938+
// If this is a TYP_FLOAT interval, and the assigned interval was TYP_DOUBLE, we also
4939+
// need to update the liveRegs to specify that the other half is not live anymore.
4940+
// As mentioned above, for TYP_DOUBLE, the other half will be unassigned further below.
4941+
if ((interval->registerType == TYP_FLOAT) &&
4942+
((targetRegRecord->assignedInterval != nullptr) &&
4943+
(targetRegRecord->assignedInterval->registerType == TYP_DOUBLE)))
4944+
{
4945+
RegRecord* anotherHalfRegRec = findAnotherHalfRegRec(targetRegRecord);
4946+
4947+
// Use TYP_FLOAT to get the regmask of just the half reg.
4948+
liveRegs &= ~getRegMask(anotherHalfRegRec->regNum, TYP_FLOAT);
4949+
}
4950+
49374951
#endif // TARGET_ARM
49384952
unassignIntervalBlockStart(targetRegRecord, allocationPassComplete ? nullptr : inVarToRegMap);
49394953
assignPhysReg(targetRegRecord, interval);

0 commit comments

Comments
 (0)