@@ -675,7 +675,7 @@ void AArch64FrameLowering::emitCalleeSavedGPRLocations(
675675 CFIInstBuilder CFIBuilder (MBB, MBBI, MachineInstr::FrameSetup);
676676 for (const auto &Info : CSI) {
677677 unsigned FrameIdx = Info.getFrameIdx ();
678- if (MFI.getStackID (FrameIdx) == TargetStackID::ScalableVector )
678+ if (MFI.isScalableStackID (FrameIdx))
679679 continue ;
680680
681681 assert (!Info.isSpilledToReg () && " Spilling to registers not implemented" );
@@ -708,7 +708,7 @@ void AArch64FrameLowering::emitCalleeSavedSVELocations(
708708 CFIInstBuilder CFIBuilder (MBB, MBBI, MachineInstr::FrameSetup);
709709
710710 for (const auto &Info : CSI) {
711- if (!( MFI.getStackID (Info.getFrameIdx ()) == TargetStackID::ScalableVector ))
711+ if (!MFI.isScalableStackID (Info.getFrameIdx ()))
712712 continue ;
713713
714714 // Not all unwinders may know about SVE registers, so assume the lowest
@@ -775,8 +775,7 @@ static void emitCalleeSavedRestores(MachineBasicBlock &MBB,
775775 CFIInstBuilder CFIBuilder (MBB, MBBI, MachineInstr::FrameDestroy);
776776
777777 for (const auto &Info : CSI) {
778- if (SVE !=
779- (MFI.getStackID (Info.getFrameIdx ()) == TargetStackID::ScalableVector))
778+ if (SVE != MFI.isScalableStackID (Info.getFrameIdx ()))
780779 continue ;
781780
782781 MCRegister Reg = Info.getReg ();
@@ -2812,7 +2811,7 @@ AArch64FrameLowering::getFrameIndexReferenceFromSP(const MachineFunction &MF,
28122811 const auto *AFI = MF.getInfo <AArch64FunctionInfo>();
28132812 bool FPAfterSVECalleeSaves =
28142813 isTargetWindows (MF) && AFI->getSVECalleeSavedStackSize ();
2815- if (MFI.getStackID (FI) == TargetStackID::ScalableVector ) {
2814+ if (MFI.isScalableStackID (FI)) {
28162815 if (FPAfterSVECalleeSaves &&
28172816 -ObjectOffset <= (int64_t )AFI->getSVECalleeSavedStackSize ())
28182817 return StackOffset::getScalable (ObjectOffset);
@@ -2878,7 +2877,7 @@ StackOffset AArch64FrameLowering::resolveFrameIndexReference(
28782877 const auto &MFI = MF.getFrameInfo ();
28792878 int64_t ObjectOffset = MFI.getObjectOffset (FI);
28802879 bool isFixed = MFI.isFixedObjectIndex (FI);
2881- bool isSVE = MFI.getStackID (FI) == TargetStackID::ScalableVector ;
2880+ bool isSVE = MFI.isScalableStackID (FI);
28822881 return resolveFrameOffsetReference (MF, ObjectOffset, isFixed, isSVE, FrameReg,
28832882 PreferFP, ForSimm);
28842883}
@@ -3614,10 +3613,14 @@ bool AArch64FrameLowering::spillCalleeSavedRegisters(
36143613 }
36153614 // Update the StackIDs of the SVE stack slots.
36163615 MachineFrameInfo &MFI = MF.getFrameInfo ();
3617- if (RPI.Type == RegPairInfo::ZPR || RPI. Type == RegPairInfo::PPR ) {
3616+ if (RPI.Type == RegPairInfo::ZPR) {
36183617 MFI.setStackID (FrameIdxReg1, TargetStackID::ScalableVector);
36193618 if (RPI.isPaired ())
36203619 MFI.setStackID (FrameIdxReg2, TargetStackID::ScalableVector);
3620+ } else if (RPI.Type == RegPairInfo::PPR) {
3621+ MFI.setStackID (FrameIdxReg1, TargetStackID::ScalablePredVector);
3622+ if (RPI.isPaired ())
3623+ MFI.setStackID (FrameIdxReg2, TargetStackID::ScalablePredVector);
36213624 }
36223625
36233626 if (X0Scratch != AArch64::NoRegister)
@@ -3832,8 +3835,7 @@ void AArch64FrameLowering::determineStackHazardSlot(
38323835 for (auto &MI : MBB) {
38333836 std::optional<int > FI = getLdStFrameID (MI, MFI);
38343837 if (FI && *FI >= 0 && *FI < (int )FrameObjects.size ()) {
3835- if (MFI.getStackID (*FI) == TargetStackID::ScalableVector ||
3836- AArch64InstrInfo::isFpOrNEON (MI))
3838+ if (MFI.isScalableStackID (*FI) || AArch64InstrInfo::isFpOrNEON (MI))
38373839 FrameObjects[*FI] |= 2 ;
38383840 else
38393841 FrameObjects[*FI] |= 1 ;
@@ -4301,7 +4303,7 @@ static int64_t determineSVEStackObjectOffsets(MachineFrameInfo &MFI,
43014303#ifndef NDEBUG
43024304 // First process all fixed stack objects.
43034305 for (int I = MFI.getObjectIndexBegin (); I != 0 ; ++I)
4304- assert (MFI.getStackID (I) != TargetStackID::ScalableVector &&
4306+ assert (! MFI.isScalableStackID (I) &&
43054307 " SVE vectors should never be passed on the stack by value, only by "
43064308 " reference." );
43074309#endif
@@ -4335,12 +4337,11 @@ static int64_t determineSVEStackObjectOffsets(MachineFrameInfo &MFI,
43354337 int StackProtectorFI = -1 ;
43364338 if (MFI.hasStackProtectorIndex ()) {
43374339 StackProtectorFI = MFI.getStackProtectorIndex ();
4338- if (MFI.getStackID (StackProtectorFI) == TargetStackID::ScalableVector )
4340+ if (MFI.isScalableStackID (StackProtectorFI))
43394341 ObjectsToAllocate.push_back (StackProtectorFI);
43404342 }
43414343 for (int I = 0 , E = MFI.getObjectIndexEnd (); I != E; ++I) {
4342- unsigned StackID = MFI.getStackID (I);
4343- if (StackID != TargetStackID::ScalableVector)
4344+ if (!MFI.isScalableStackID (I))
43444345 continue ;
43454346 if (I == StackProtectorFI)
43464347 continue ;
@@ -5372,8 +5373,7 @@ void AArch64FrameLowering::orderFrameObjects(
53725373 if (AFI.hasStackHazardSlotIndex ()) {
53735374 std::optional<int > FI = getLdStFrameID (MI, MFI);
53745375 if (FI && *FI >= 0 && *FI < (int )FrameObjects.size ()) {
5375- if (MFI.getStackID (*FI) == TargetStackID::ScalableVector ||
5376- AArch64InstrInfo::isFpOrNEON (MI))
5376+ if (MFI.isScalableStackID (*FI) || AArch64InstrInfo::isFpOrNEON (MI))
53775377 FrameObjects[*FI].Accesses |= FrameObject::AccessFPR;
53785378 else
53795379 FrameObjects[*FI].Accesses |= FrameObject::AccessGPR;
@@ -5731,7 +5731,7 @@ void AArch64FrameLowering::emitRemarks(
57315731 }
57325732
57335733 unsigned RegTy = StackAccess::AccessType::GPR;
5734- if (MFI.getStackID (FrameIdx) == TargetStackID::ScalableVector ) {
5734+ if (MFI.isScalableStackID (FrameIdx)) {
57355735 // SPILL_PPR_TO_ZPR_SLOT_PSEUDO and FILL_PPR_FROM_ZPR_SLOT_PSEUDO
57365736 // spill/fill the predicate as a data vector (so are an FPR access).
57375737 if (MI.getOpcode () != AArch64::SPILL_PPR_TO_ZPR_SLOT_PSEUDO &&
0 commit comments