@@ -302,7 +302,11 @@ void LinearScan::updateNextFixedRef(RegRecord* regRecord, RefPosition* nextRefPo
302302SingleTypeRegSet LinearScan::getMatchingConstants(SingleTypeRegSet mask, Interval* currentInterval, RefPosition* refPosition)
303303{
304304 assert(currentInterval->isConstant && RefTypeIsDef(refPosition->refType));
305+ #ifdef TARGET_ARM64
305306 SingleTypeRegSet candidates = (mask & m_RegistersWithConstants).GetRegSetForType(currentInterval->registerType);
307+ #else
308+ SingleTypeRegSet candidates = (mask & m_RegistersWithConstants);
309+ #endif
306310 SingleTypeRegSet result = RBM_NONE;
307311 while (candidates != RBM_NONE)
308312 {
@@ -495,7 +499,12 @@ SingleTypeRegSet LinearScan::getConstrainedRegMask(RefPosition* refPosition,
495499
496500 if ((refPosition != nullptr) && !refPosition->RegOptional())
497501 {
498- SingleTypeRegSet busyRegs = (regsBusyUntilKill | regsInUseThisLocation).GetRegSetForType(TYP_VOID); //TODO: Pass the right type
502+ #ifdef TARGET_ARM64
503+ // TODO-lsra: Pass the right type
504+ SingleTypeRegSet busyRegs = (regsBusyUntilKill | regsInUseThisLocation).GetRegSetForType(TYP_VOID);
505+ #else
506+ SingleTypeRegSet busyRegs = (regsBusyUntilKill | regsInUseThisLocation);
507+ #endif
499508 if ((newMask & ~busyRegs) == RBM_NONE)
500509 {
501510 // Constrained mask does not have at least one free register to allocate.
@@ -13481,8 +13490,14 @@ SingleTypeRegSet LinearScan::RegisterSelection::select(Interval*
1348113490 if (currentInterval->isWriteThru)
1348213491 {
1348313492 // We'll only prefer a callee-save register if it's already been used.
13493+ #ifdef TARGET_ARM64
1348413494 SingleTypeRegSet unusedCalleeSaves =
1348513495 calleeSaveCandidates & ~(linearScan->compiler->codeGen->regSet.rsGetModifiedRegsMask()).GetRegSetForType(regType);
13496+ #else
13497+ SingleTypeRegSet unusedCalleeSaves =
13498+ calleeSaveCandidates &
13499+ ~(linearScan->compiler->codeGen->regSet.rsGetModifiedRegsMask());
13500+ #endif
1348613501 callerCalleePrefs = calleeSaveCandidates & ~unusedCalleeSaves;
1348713502 preferences &= ~unusedCalleeSaves;
1348813503 }
@@ -13531,7 +13546,11 @@ SingleTypeRegSet LinearScan::RegisterSelection::select(Interval*
1353113546 // TODO-CQ: We assign same registerAssignment to UPPER_RESTORE and the next USE.
1353213547 // When we allocate for USE, we see that the register is busy at current location
1353313548 // and we end up with that candidate is no longer available.
13549+ #ifdef TARGET_ARM64
1353413550 SingleTypeRegSet busyRegs = (linearScan->regsBusyUntilKill | linearScan->regsInUseThisLocation).GetRegSetForType(regType);
13551+ #else
13552+ SingleTypeRegSet busyRegs = (linearScan->regsBusyUntilKill | linearScan->regsInUseThisLocation);
13553+ #endif
1353513554 candidates &= ~busyRegs;
1353613555
1353713556#ifdef TARGET_ARM
@@ -13553,7 +13572,11 @@ SingleTypeRegSet LinearScan::RegisterSelection::select(Interval*
1355313572 // Also eliminate as busy any register with a conflicting fixed reference at this or
1355413573 // the next location.
1355513574 // Note that this will eliminate the fixedReg, if any, but we'll add it back below.
13575+ #ifdef TARGET_ARM64
1355613576 SingleTypeRegSet checkConflictMask = candidates & linearScan->fixedRegs.GetRegSetForType(regType);
13577+ #else
13578+ SingleTypeRegSet checkConflictMask = candidates & linearScan->fixedRegs;
13579+ #endif
1355713580 while (checkConflictMask != RBM_NONE)
1355813581 {
1355913582 regNumber checkConflictReg = genFirstRegNumFromMask(checkConflictMask);
@@ -13853,7 +13876,11 @@ SingleTypeRegSet LinearScan::RegisterSelection::selectMinimal(
1385313876 // TODO-CQ: We assign same registerAssignment to UPPER_RESTORE and the next USE.
1385413877 // When we allocate for USE, we see that the register is busy at current location
1385513878 // and we end up with that candidate is no longer available.
13879+ #ifdef TARGET_ARM64
1385613880 SingleTypeRegSet busyRegs = (linearScan->regsBusyUntilKill | linearScan->regsInUseThisLocation).GetRegSetForType(regType);
13881+ #else
13882+ SingleTypeRegSet busyRegs = (linearScan->regsBusyUntilKill | linearScan->regsInUseThisLocation);
13883+ #endif // TARGET_ARM64
1385713884 candidates &= ~busyRegs;
1385813885
1385913886#ifdef TARGET_ARM
@@ -13871,7 +13898,11 @@ SingleTypeRegSet LinearScan::RegisterSelection::selectMinimal(
1387113898 // Also eliminate as busy any register with a conflicting fixed reference at this or
1387213899 // the next location.
1387313900 // Note that this will eliminate the fixedReg, if any, but we'll add it back below.
13901+ #ifdef TARGET_ARM64
1387413902 SingleTypeRegSet checkConflictMask = candidates & linearScan->fixedRegs.GetRegSetForType(regType);
13903+ #else
13904+ SingleTypeRegSet checkConflictMask = candidates & linearScan->fixedRegs;
13905+ #endif
1387513906 while (checkConflictMask != RBM_NONE)
1387613907 {
1387713908 regNumber checkConflictReg = genFirstRegNumFromMask(checkConflictMask);
0 commit comments