@@ -74,13 +74,10 @@ class AArch64FunctionInfo final : public MachineFunctionInfo {
7474 // / Amount of stack frame size, not including callee-saved registers.
7575 uint64_t LocalStackSize = 0 ;
7676
77- // / The start and end frame indices for the SVE callee saves.
78- int MinSVECSFrameIndex = 0 ;
79- int MaxSVECSFrameIndex = 0 ;
80-
8177 // / Amount of stack frame size used for saving callee-saved registers.
8278 unsigned CalleeSavedStackSize = 0 ;
83- unsigned SVECalleeSavedStackSize = 0 ;
79+ unsigned ZPRCalleeSavedStackSize = 0 ;
80+ unsigned PPRCalleeSavedStackSize = 0 ;
8481 bool HasCalleeSavedStackSize = false ;
8582 bool HasSVECalleeSavedStackSize = false ;
8683
@@ -137,9 +134,10 @@ class AArch64FunctionInfo final : public MachineFunctionInfo {
137134 // / SVE stack size (for predicates and data vectors) are maintained here
138135 // / rather than in FrameInfo, as the placement and Stack IDs are target
139136 // / specific.
140- uint64_t StackSizeSVE = 0 ;
137+ uint64_t StackSizeZPR = 0 ;
138+ uint64_t StackSizePPR = 0 ;
141139
142- // / HasCalculatedStackSizeSVE indicates whether StackSizeSVE is valid.
140+ // / HasCalculatedStackSizeSVE indicates whether StackSizeZPR/PPR is valid.
143141 bool HasCalculatedStackSizeSVE = false ;
144142
145143 // / Has a value when it is known whether or not the function uses a
@@ -312,16 +310,25 @@ class AArch64FunctionInfo final : public MachineFunctionInfo {
312310 TailCallReservedStack = bytes;
313311 }
314312
315- bool hasCalculatedStackSizeSVE () const { return HasCalculatedStackSizeSVE; }
316-
317- void setStackSizeSVE ( uint64_t S) {
313+ void setStackSizeSVE ( uint64_t ZPR, uint64_t PPR) {
314+ StackSizeZPR = ZPR;
315+ StackSizePPR = PPR;
318316 HasCalculatedStackSizeSVE = true ;
319- StackSizeSVE = S;
320317 }
321318
322- uint64_t getStackSizeSVE () const {
319+ uint64_t getStackSizeZPR () const {
323320 assert (hasCalculatedStackSizeSVE ());
324- return StackSizeSVE;
321+ return StackSizeZPR;
322+ }
323+ uint64_t getStackSizePPR () const {
324+ assert (hasCalculatedStackSizeSVE ());
325+ return StackSizePPR;
326+ }
327+
328+ bool hasCalculatedStackSizeSVE () const { return HasCalculatedStackSizeSVE; }
329+
330+ bool hasSVEStackSize () const {
331+ return getStackSizeZPR () > 0 || getStackSizePPR () > 0 ;
325332 }
326333
327334 bool hasStackFrame () const { return HasStackFrame; }
@@ -414,23 +421,25 @@ class AArch64FunctionInfo final : public MachineFunctionInfo {
414421 }
415422
416423 // Saves the CalleeSavedStackSize for SVE vectors in 'scalable bytes'
417- void setSVECalleeSavedStackSize (unsigned Size) {
418- SVECalleeSavedStackSize = Size;
424+ void setSVECalleeSavedStackSize (unsigned ZPR, unsigned PPR) {
425+ ZPRCalleeSavedStackSize = ZPR;
426+ PPRCalleeSavedStackSize = PPR;
419427 HasSVECalleeSavedStackSize = true ;
420428 }
421- unsigned getSVECalleeSavedStackSize () const {
429+ unsigned getZPRCalleeSavedStackSize () const {
422430 assert (HasSVECalleeSavedStackSize &&
423- " SVECalleeSavedStackSize has not been calculated" );
424- return SVECalleeSavedStackSize ;
431+ " ZPRCalleeSavedStackSize has not been calculated" );
432+ return ZPRCalleeSavedStackSize ;
425433 }
426-
427- void setMinMaxSVECSFrameIndex ( int Min, int Max) {
428- MinSVECSFrameIndex = Min ;
429- MaxSVECSFrameIndex = Max ;
434+ unsigned getPPRCalleeSavedStackSize () const {
435+ assert (HasSVECalleeSavedStackSize &&
436+ " PPRCalleeSavedStackSize has not been calculated " ) ;
437+ return PPRCalleeSavedStackSize ;
430438 }
431439
432- int getMinSVECSFrameIndex () const { return MinSVECSFrameIndex; }
433- int getMaxSVECSFrameIndex () const { return MaxSVECSFrameIndex; }
440+ unsigned getSVECalleeSavedStackSize () const {
441+ return getZPRCalleeSavedStackSize () + getPPRCalleeSavedStackSize ();
442+ }
434443
435444 void incNumLocalDynamicTLSAccesses () { ++NumLocalDynamicTLSAccesses; }
436445 unsigned getNumLocalDynamicTLSAccesses () const {
@@ -611,7 +620,8 @@ class AArch64FunctionInfo final : public MachineFunctionInfo {
611620namespace yaml {
612621struct AArch64FunctionInfo final : public yaml::MachineFunctionInfo {
613622 std::optional<bool > HasRedZone;
614- std::optional<uint64_t > StackSizeSVE;
623+ std::optional<uint64_t > StackSizeZPR;
624+ std::optional<uint64_t > StackSizePPR;
615625 std::optional<bool > HasStackFrame;
616626
617627 AArch64FunctionInfo () = default ;
@@ -624,7 +634,8 @@ struct AArch64FunctionInfo final : public yaml::MachineFunctionInfo {
624634template <> struct MappingTraits <AArch64FunctionInfo> {
625635 static void mapping (IO &YamlIO, AArch64FunctionInfo &MFI) {
626636 YamlIO.mapOptional (" hasRedZone" , MFI.HasRedZone );
627- YamlIO.mapOptional (" stackSizeSVE" , MFI.StackSizeSVE );
637+ YamlIO.mapOptional (" stackSizeZPR" , MFI.StackSizeZPR );
638+ YamlIO.mapOptional (" stackSizePPR" , MFI.StackSizePPR );
628639 YamlIO.mapOptional (" hasStackFrame" , MFI.HasStackFrame );
629640 }
630641};
0 commit comments