[llvm] Reserve R9 on armv6 iOS before 3.0 (PR #150835)

via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 2 08:38:13 PDT 2025


https://github.com/Un1q32 updated https://github.com/llvm/llvm-project/pull/150835

>From 55f1ff02405cdab0c22c5a32b576f06d020ee3b6 Mon Sep 17 00:00:00 2001
From: Un1q32 <joey.t.reinhart at gmail.com>
Date: Sun, 27 Jul 2025 08:34:45 -0400
Subject: [PATCH] Reserve R9 on iOS before 3.0

---
 llvm/lib/Target/ARM/ARMSubtarget.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/llvm/lib/Target/ARM/ARMSubtarget.cpp b/llvm/lib/Target/ARM/ARMSubtarget.cpp
index 9f600e0c685ab..d6e226736ba66 100644
--- a/llvm/lib/Target/ARM/ARMSubtarget.cpp
+++ b/llvm/lib/Target/ARM/ARMSubtarget.cpp
@@ -227,7 +227,10 @@ void ARMSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
       (Options.UnsafeFPMath || isTargetDarwin()))
     HasNEONForFP = true;
 
-  if (isRWPI())
+  if (isRWPI() ||
+      (isTargetIOS() &&
+       ARM::parseArch(TargetTriple.getArchName()) == ARM::ArchKind::ARMV6K &&
+       TargetTriple.isOSVersionLT(3, 0)))
     ReserveR9 = true;
 
   // If MVEVectorCostFactor is still 0 (has not been set to anything else), default it to 2



More information about the llvm-commits mailing list