[llvm-branch-commits] [llvm] [AArch64][SME] Support split ZPR and PPR area allocation (PR #142392)

Sander de Smalen via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Sep 29 03:14:52 PDT 2025


================
@@ -1409,10 +1428,17 @@ StackOffset AArch64FrameLowering::resolveFrameOffsetReference(
       isTargetWindows(MF) && AFI->getSVECalleeSavedStackSize();
 
   if (isSVE) {
+    StackOffset AccessOffset{};
----------------
sdesmalen-arm wrote:

I found this logic quite difficult to follow without any comments to explain it. If it would have been written like something like below, it would have made it easier to follow:

```
StackOffset FPOffset = ...;
StackOffset SPOffset = ...;
// ObjectOffset assumes ZPR and PPR are allocated together and does not account for
// for the split, so we must adjust the offsets.
if (AFI->hasSplitSVEObjects() && MFI.getStackID(FI) == TargetStackID::ScalableVector) {
  // Accessing the SVE area from FP, requires jumping over/offsetting by the predicate area.
  FPOffset -= PPRStackSize;
  // SVEStackSize includes both predicates and data-vectors, so must subtract predicate size.
}
```
Maybe that's subjective, but I think extra comments definitely help.

https://github.com/llvm/llvm-project/pull/142392


More information about the llvm-branch-commits mailing list