Skip to content

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/coreclr/jit/lsrabuild.cpp

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3207,8 +3207,24 @@ void LinearScan::BuildStoreLocDef(GenTreeLclVarCommon* storeLoc,
32073207
srcInterval->assignRelatedInterval(varDefInterval);
32083208
}
32093209
}
3210-
RefPosition* def =
3211-
newRefPosition(varDefInterval, currentLoc + 1, RefTypeDef, storeLoc, allRegs(varDsc->TypeGet()), index);
3210+
3211+
regMaskTP defCandidates = RBM_NONE;
3212+
var_types type = varDsc->TypeGet();
3213+
3214+
#ifdef TARGET_X86
3215+
if (varTypeIsByte(type))
3216+
{
3217+
defCandidates = allByteRegs();
3218+
}
3219+
else
3220+
{
3221+
defCandidates = allRegs(type);
3222+
}
3223+
#else
3224+
defCandidates = allRegs(type);
3225+
#endif // TARGET_X86
3226+
3227+
RefPosition* def = newRefPosition(varDefInterval, currentLoc + 1, RefTypeDef, storeLoc, defCandidates, index);
32123228
if (varDefInterval->isWriteThru)
32133229
{
32143230
// We always make write-thru defs reg-optional, as we can store them if they don't

0 commit comments

Comments
 (0)