[llvm] Reserve R9 on armv6 iOS before 3.0 (PR #150835)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 27 08:52:21 PDT 2025
https://github.com/Un1q32 created https://github.com/llvm/llvm-project/pull/150835
The iOS 2.0 ABI had R9 as a reserved register, 3.0 made it available, but support for the 2.0 ABI was never added to LLVM. We only use the 2.0 ABI on armv6 since before 3.0 armv6 was the only architecture supported by iOS.
>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