[llvm] [AArch64] Fix incorrect frame indexes for ZPR callee-saved pair spills (PR #228368)

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 5 08:04:14 PDT 2026


================
@@ -1827,12 +1845,21 @@ void computeCalleeSaveRegisterPairs(const AArch64FrameLowering &AFL,
       case RegPairInfo::PPR:
         break;
       case RegPairInfo::ZPR:
-        if (!NeedsWinCFI && AFI->getPredicateRegForFillSpill() != 0 &&
-            ((RPI.Reg1 - AArch64::Z0) & 1) == 0 && (NextReg == RPI.Reg1 + 1)) {
-          // Calculate offset of register pair to see if pair instruction can be
-          // used.
-          int Offset = (ScalableByteOffset + StackFillDir * 2 * Scale) / Scale;
-          if ((-16 <= Offset && Offset <= 14) && (Offset % 2 == 0))
+        // Windows support is possible but the order requirement is reversed.
+        // Also, WinCFI has no support for group ZPR loads/stores yet.
----------------
MacDue wrote:

FYI: Implementing this should wait until WinCFI supports ZPRs as my understanding is that Windows pretty much always enables CFI. 

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


More information about the llvm-commits mailing list