[llvm-branch-commits] [llvm] [AArch64] Prepare for split ZPR and PPR area allocation (NFCI) (PR #142391)
Sander de Smalen via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Jul 7 09:04:23 PDT 2025
================
@@ -4294,24 +4396,32 @@ static int64_t determineSVEStackObjectOffsets(MachineFrameInfo &MFI,
report_fatal_error(
"Alignment of scalable vectors > 16 bytes is not yet supported");
+ int64_t &Offset = OffsetForObject(FI, ZPROffset, PPROffset);
Offset = alignTo(Offset + MFI.getObjectSize(FI), Alignment);
if (AssignOffsets)
Assign(FI, -Offset);
}
- return Offset;
+ PPROffset = alignTo(PPROffset, Align(16U));
+ ZPROffset = alignTo(ZPROffset, Align(16U));
+
+ if (&ZPROffset != &PPROffset) {
+ // SplitSVEObjects (PPRs and ZPRs allocated to separate areas).
+ return SVEStackSizes{ZPROffset, PPROffset};
+ }
+ // When SplitSVEObjects is disabled just attribute all the stack to ZPRs.
+ // Determining the split is not necessary.
+ return SVEStackSizes{ZPROffset, 0};
----------------
sdesmalen-arm wrote:
When you use an instance of the return type (`SVEStackSizes`) instead of `ZPRStack` and `PPRStack`, then you can just return that struct at the end of this function.
https://github.com/llvm/llvm-project/pull/142391
More information about the llvm-branch-commits
mailing list