diff options
| author | Bob Wilson <bob.wilson@apple.com> | 2009-06-22 21:01:46 +0000 |
|---|---|---|
| committer | Bob Wilson <bob.wilson@apple.com> | 2009-06-22 21:01:46 +0000 |
| commit | 54fc124d72512d65d62565cabcd85c7b07496513 (patch) | |
| tree | fd3bb71f357d256161f5fddcec44f3452b5f45eb /lib/Target/ARM/ARMSubtarget.cpp | |
| parent | 08bc98e3cc1c6859ee78f304c0182098b580b56f (diff) | |
| download | external_llvm-54fc124d72512d65d62565cabcd85c7b07496513.zip external_llvm-54fc124d72512d65d62565cabcd85c7b07496513.tar.gz external_llvm-54fc124d72512d65d62565cabcd85c7b07496513.tar.bz2 | |
For Darwin on ARMv6 and newer, make register r9 available for use as a
caller-saved register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73901 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMSubtarget.cpp')
| -rw-r--r-- | lib/Target/ARM/ARMSubtarget.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Target/ARM/ARMSubtarget.cpp b/lib/Target/ARM/ARMSubtarget.cpp index 7ac7b49..4aa249a 100644 --- a/lib/Target/ARM/ARMSubtarget.cpp +++ b/lib/Target/ARM/ARMSubtarget.cpp @@ -16,15 +16,20 @@ #include "llvm/Module.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetOptions.h" +#include "llvm/Support/CommandLine.h" using namespace llvm; +static cl::opt<bool> +ReserveR9("arm-reserve-r9", cl::Hidden, + cl::desc("Reserve R9, making it unavailable as GPR")); + ARMSubtarget::ARMSubtarget(const Module &M, const std::string &FS, bool isThumb) : ARMArchVersion(V4T) , ARMFPUType(None) , IsThumb(isThumb) , ThumbMode(Thumb1) - , IsR9Reserved(false) + , IsR9Reserved(ReserveR9) , stackAlignment(4) , CPUString("generic") , TargetType(isELF) // Default to ELF unless otherwise specified. @@ -83,5 +88,5 @@ ARMSubtarget::ARMSubtarget(const Module &M, const std::string &FS, stackAlignment = 8; if (isTargetDarwin()) - IsR9Reserved = true; + IsR9Reserved = ReserveR9 | (ARMArchVersion < V6); } |
