Skip to content

Commit d9d7d0f

Browse files
committed
Tweaks
1 parent 5f63c34 commit d9d7d0f

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

llvm/lib/Target/AArch64/AArch64PrologueEpilogue.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,24 +1530,24 @@ void AArch64EpilogueEmitter::emitEpilogue() {
15301530
(AFI->isStackRealigned() || MFI.hasVarSizedObjects()) ? AArch64::FP
15311531
: AArch64::SP;
15321532
if (SVECalleeSavesSize && BaseForSVEDealloc == AArch64::FP) {
1533-
// The offset from the frame-pointer to the start of the ZPR/PPR CSRs.
1534-
StackOffset FPOffsetZPRCSRs =
1533+
// The offset from the frame-pointer to the start of the ZPR saves.
1534+
StackOffset FPOffsetZPR =
15351535
-SVECalleeSavesSize -
15361536
StackOffset::getFixed(AFI->getCalleeSaveBaseToFrameRecordOffset());
1537-
StackOffset FPOffsetPPRCSRs = FPOffsetZPRCSRs + ZPR.CalleeSavesSize;
15381537

15391538
// With split SVE, the PPR locals are above the ZPR callee-saves.
15401539
if (ZPR.CalleeSavesSize && SVELayout == SVEStackLayout::Split)
1541-
FPOffsetZPRCSRs -= PPR.LocalsSize;
1540+
FPOffsetZPR -= PPR.LocalsSize;
15421541

1543-
// The code below will deallocate the stack space space by moving the SP
1544-
// to the start of the ZPR/PPR callee-save area.
1545-
moveSPBelowFP(ZPRRange.Begin, FPOffsetZPRCSRs);
1542+
// Deallocate the stack space space by moving the SP to the start of the
1543+
// ZPR/PPR callee-save area.
1544+
moveSPBelowFP(ZPRRange.Begin, FPOffsetZPR);
15461545

15471546
if (PPR.CalleeSavesSize && SVELayout == SVEStackLayout::Split) {
15481547
// Move to the start of the PPR area (this offset may be zero).
1548+
StackOffset FPOffsetPPR = -PPR.CalleeSavesSize;
15491549
emitFrameOffset(MBB, ZPRRange.End, DL, AArch64::SP, AArch64::SP,
1550-
FPOffsetPPRCSRs - FPOffsetZPRCSRs, TII,
1550+
FPOffsetPPR - FPOffsetZPR, TII,
15511551
MachineInstr::FrameDestroy);
15521552
}
15531553
} else if (BaseForSVEDealloc == AArch64::SP) {

llvm/test/CodeGen/AArch64/split-sve-stack-frame-layout.ll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,5 +1092,3 @@ define void @sve_locals_zpr_ppr_csr_vla(i64 %n, <vscale x 16 x i1> %pred, <vscal
10921092
store volatile <vscale x 16 x i8> %vector, ptr %zpr_local
10931093
ret void
10941094
}
1095-
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
1096-
; CHECK-FRAMELAYOUT: {{.*}}

0 commit comments

Comments
 (0)