void Compiler::lvaAssignFrameOffsets(FrameLayoutState curState)
{
- noway_assert(lvaDoneFrameLayout < curState);
+ noway_assert((lvaDoneFrameLayout < curState) || (curState == REGALLOC_FRAME_LAYOUT));
lvaDoneFrameLayout = curState;
mustPredict |= rpLostEnreg;
#ifdef _TARGET_ARM_
-
// See if we previously reserved REG_R10 and try to make it available if we have a small frame now
- //
- if ((rpPasses == 0) && (codeGen->regSet.rsMaskResvd & RBM_OPT_RSVD))
+ if ((rpPasses == 0) && ((codeGen->regSet.rsMaskResvd & RBM_OPT_RSVD) != 0) && !compRsvdRegCheck(REGALLOC_FRAME_LAYOUT))
{
- if (compRsvdRegCheck(REGALLOC_FRAME_LAYOUT))
- {
- // We must keep reserving R10 in this case
- codeGen->regSet.rsMaskResvd |= RBM_OPT_RSVD;
- }
- else
- {
- // We can release our reservation on R10 and use it to color registers
- //
- codeGen->regSet.rsMaskResvd &= ~RBM_OPT_RSVD;
- allAcceptableRegs |= RBM_OPT_RSVD;
- }
+ // We can release our reservation on R10 and use it to color registers
+ codeGen->regSet.rsMaskResvd &= ~RBM_OPT_RSVD;
+ allAcceptableRegs |= RBM_OPT_RSVD;
}
#endif
/* Decide whether we need to set mustPredict */
mustPredict = false;
+#ifdef _TARGET_ARM_
+ // The spill count may be now high enough that we now need to reserve r10. If this is the case, we'll need to
+ // reservation r10 and if it was used repredict.
+ if (((codeGen->regSet.rsMaskResvd & RBM_OPT_RSVD) == 0) && compRsvdRegCheck(REGALLOC_FRAME_LAYOUT))
+ {
+ codeGen->regSet.rsMaskResvd |= RBM_OPT_RSVD;
+ allAcceptableRegs &= ~RBM_OPT_RSVD;
+ mustPredict = (regUsed & RBM_OPT_RSVD) != 0;
+ }
+#endif
+
if (rpAddedVarIntf)
{
mustPredict = true;