make arm-reserve-r9 available for all ARM
authorRenato Golin <renato.golin@linaro.org>
Thu, 15 Aug 2013 20:45:13 +0000 (20:45 +0000)
committerRenato Golin <renato.golin@linaro.org>
Thu, 15 Aug 2013 20:45:13 +0000 (20:45 +0000)
r9 is defined as a platform-specific register in the ARM EABI.
It can be reserved for a special purpose or be used as a general
purpose register. Add support for reserving r9 for all ARM, while
leaving the IOS usage unchanged.

Patch by Jeroen Hofstee.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188485 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMSubtarget.cpp

index c592421d9a5f043db16a00b951807f2df1f1ec17..a94c9425fb5f3434b7c3e1e571796064c075a927 100644 (file)
@@ -169,9 +169,10 @@ void ARMSubtarget::resetSubtargetFeatures(StringRef CPU, StringRef FS) {
   if (isAAPCS_ABI())
     stackAlignment = 8;
 
-  if (!isTargetIOS())
+  if (!isTargetIOS()) {
     UseMovt = hasV6T2Ops();
-  else {
+    IsR9Reserved = ReserveR9;
+  } else {
     IsR9Reserved = ReserveR9 | !HasV6Ops;
     UseMovt = DarwinUseMOVT && hasV6T2Ops();
     SupportsTailCall = !getTargetTriple().isOSVersionLT(5, 0);