copyRegsToFree = RBM_NONE;
regsInUseThisLocation = regsInUseNextLocation;
regsInUseNextLocation = RBM_NONE;
+#ifdef TARGET_ARM64
+ if (hasConsecutiveRegister)
+ {
+ consecutiveRegsInUseThisLocation = RBM_NONE;
+ }
+#endif
if ((regsToFree | delayRegsToFree) != RBM_NONE)
{
freeRegisters(regsToFree);
// It doesn't satisfy, so do a copyReg for the first RefPosition to such a register, so
// it would be possible to allocate consecutive registers to the subsequent RefPositions.
regNumber copyReg = assignCopyReg<true>(¤tRefPosition);
+ assignConsecutiveRegisters(¤tRefPosition, copyReg);
if (copyReg != assignedRegister)
{
regMaskTP copyRegMask = getRegMask(copyReg, currentInterval->registerType);
regMaskTP assignedRegMask = getRegMask(assignedRegister, currentInterval->registerType);
+ if ((consecutiveRegsInUseThisLocation & assignedRegMask) != RBM_NONE)
+ {
+ // If assigned register is one of the consecutive register we are about to assign
+ // to the subsequent RefPositions, do not mark it busy otherwise when we allocate
+ // for that particular subsequent RefPosition, we will not find any candidates
+ // available. Not marking it busy should be fine because we have already set the
+ // register assignments for all the consecutive refpositions.
+ assignedRegMask = RBM_NONE;
+ }
+
// For consecutive register, although it shouldn't matter what the assigned register was,
// because we have just assigned it `copyReg` and that's the one in-use, and not the
// one that was assigned previously. However, in situation where an upper-vector restore
currentRefPosition.registerAssignment = assignedRegBit;
}
- assignConsecutiveRegisters(¤tRefPosition, copyReg);
continue;
}
}
// registers.
assignConsecutiveRegisters(¤tRefPosition, copyReg);
}
+
+ if ((consecutiveRegsInUseThisLocation & assignedRegMask) != RBM_NONE)
+ {
+ // If assigned register is one of the consecutive register we are about to assign
+ // to the subsequent RefPositions, do not mark it busy otherwise when we allocate
+ // for that particular subsequent RefPosition, we will not find any candidates
+ // available. Not marking it busy should be fine because we have already set the
+ // register assignments for all the consecutive refpositions.
+ assignedRegMask = RBM_NONE;
+ }
}
#endif
// For consecutive register, although it shouldn't matter what the assigned register was,
assert(firstRefPosition->assignedReg() == firstRegAssigned);
assert(firstRefPosition->isFirstRefPositionOfConsecutiveRegisters());
assert(emitter::isVectorRegister(firstRegAssigned));
+ assert(consecutiveRegsInUseThisLocation == RBM_NONE);
RefPosition* consecutiveRefPosition = getNextConsecutiveRefPosition(firstRefPosition);
regNumber regToAssign = firstRegAssigned == REG_FP_LAST ? REG_FP_FIRST : REG_NEXT(firstRegAssigned);
assert(firstRefPosition->refType != RefTypeUpperVectorRestore);
INDEBUG(int refPosCount = 1);
- regMaskTP busyConsecutiveRegMask = (((1ULL << firstRefPosition->regCount) - 1) << firstRegAssigned);
+ consecutiveRegsInUseThisLocation = (((1ULL << firstRefPosition->regCount) - 1) << firstRegAssigned);
while (consecutiveRefPosition != nullptr)
{
// RefTypeUpperVectorRestore positions of corresponding variables for which (another criteria)
// we are trying to find consecutive registers.
- consecutiveRefPosition->registerAssignment &= ~busyConsecutiveRegMask;
+ consecutiveRefPosition->registerAssignment &= ~consecutiveRegsInUseThisLocation;
}
consecutiveRefPosition = getNextConsecutiveRefPosition(consecutiveRefPosition);
}