@@ -74,13 +74,10 @@ class AArch64FunctionInfo final : public MachineFunctionInfo {
74
74
// / Amount of stack frame size, not including callee-saved registers.
75
75
uint64_t LocalStackSize = 0 ;
76
76
77
- // / The start and end frame indices for the SVE callee saves.
78
- int MinSVECSFrameIndex = 0 ;
79
- int MaxSVECSFrameIndex = 0 ;
80
-
81
77
// / Amount of stack frame size used for saving callee-saved registers.
82
78
unsigned CalleeSavedStackSize = 0 ;
83
- unsigned SVECalleeSavedStackSize = 0 ;
79
+ unsigned ZPRCalleeSavedStackSize = 0 ;
80
+ unsigned PPRCalleeSavedStackSize = 0 ;
84
81
bool HasCalleeSavedStackSize = false ;
85
82
bool HasSVECalleeSavedStackSize = false ;
86
83
@@ -137,9 +134,10 @@ class AArch64FunctionInfo final : public MachineFunctionInfo {
137
134
// / SVE stack size (for predicates and data vectors) are maintained here
138
135
// / rather than in FrameInfo, as the placement and Stack IDs are target
139
136
// / specific.
140
- uint64_t StackSizeSVE = 0 ;
137
+ uint64_t StackSizeZPR = 0 ;
138
+ uint64_t StackSizePPR = 0 ;
141
139
142
- // / HasCalculatedStackSizeSVE indicates whether StackSizeSVE is valid.
140
+ // / HasCalculatedStackSizeSVE indicates whether StackSizeZPR/PPR is valid.
143
141
bool HasCalculatedStackSizeSVE = false ;
144
142
145
143
// / Has a value when it is known whether or not the function uses a
@@ -312,16 +310,25 @@ class AArch64FunctionInfo final : public MachineFunctionInfo {
312
310
TailCallReservedStack = bytes;
313
311
}
314
312
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;
318
316
HasCalculatedStackSizeSVE = true ;
319
- StackSizeSVE = S;
320
317
}
321
318
322
- uint64_t getStackSizeSVE () const {
319
+ uint64_t getStackSizeZPR () const {
323
320
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 ;
325
332
}
326
333
327
334
bool hasStackFrame () const { return HasStackFrame; }
@@ -414,23 +421,25 @@ class AArch64FunctionInfo final : public MachineFunctionInfo {
414
421
}
415
422
416
423
// 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;
419
427
HasSVECalleeSavedStackSize = true ;
420
428
}
421
- unsigned getSVECalleeSavedStackSize () const {
429
+ unsigned getZPRCalleeSavedStackSize () const {
422
430
assert (HasSVECalleeSavedStackSize &&
423
- " SVECalleeSavedStackSize has not been calculated" );
424
- return SVECalleeSavedStackSize ;
431
+ " ZPRCalleeSavedStackSize has not been calculated" );
432
+ return ZPRCalleeSavedStackSize ;
425
433
}
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 ;
430
438
}
431
439
432
- int getMinSVECSFrameIndex () const { return MinSVECSFrameIndex; }
433
- int getMaxSVECSFrameIndex () const { return MaxSVECSFrameIndex; }
440
+ unsigned getSVECalleeSavedStackSize () const {
441
+ return getZPRCalleeSavedStackSize () + getPPRCalleeSavedStackSize ();
442
+ }
434
443
435
444
void incNumLocalDynamicTLSAccesses () { ++NumLocalDynamicTLSAccesses; }
436
445
unsigned getNumLocalDynamicTLSAccesses () const {
@@ -611,7 +620,8 @@ class AArch64FunctionInfo final : public MachineFunctionInfo {
611
620
namespace yaml {
612
621
struct AArch64FunctionInfo final : public yaml::MachineFunctionInfo {
613
622
std::optional<bool > HasRedZone;
614
- std::optional<uint64_t > StackSizeSVE;
623
+ std::optional<uint64_t > StackSizeZPR;
624
+ std::optional<uint64_t > StackSizePPR;
615
625
std::optional<bool > HasStackFrame;
616
626
617
627
AArch64FunctionInfo () = default ;
@@ -624,7 +634,8 @@ struct AArch64FunctionInfo final : public yaml::MachineFunctionInfo {
624
634
template <> struct MappingTraits <AArch64FunctionInfo> {
625
635
static void mapping (IO &YamlIO, AArch64FunctionInfo &MFI) {
626
636
YamlIO.mapOptional (" hasRedZone" , MFI.HasRedZone );
627
- YamlIO.mapOptional (" stackSizeSVE" , MFI.StackSizeSVE );
637
+ YamlIO.mapOptional (" stackSizeZPR" , MFI.StackSizeZPR );
638
+ YamlIO.mapOptional (" stackSizePPR" , MFI.StackSizePPR );
628
639
YamlIO.mapOptional (" hasStackFrame" , MFI.HasStackFrame );
629
640
}
630
641
};
0 commit comments