[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:51 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-arm
Author: None (Un1q32)
<details>
<summary>Changes</summary>
The iOS 2.x ABI had R9 as a reserved register, 3.0 made it available, but support for the 2.x ABI was never added to LLVM. We only use the 2.x ABI on armv6 since before 3.0 armv6 was the only architecture supported by iOS.
---
Full diff: https://github.com/llvm/llvm-project/pull/150835.diff
1 Files Affected:
- (modified) llvm/lib/Target/ARM/ARMSubtarget.cpp (+4-1)
``````````diff
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
``````````
</details>
https://github.com/llvm/llvm-project/pull/150835
More information about the llvm-commits
mailing list