summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/ARMSubtarget.h
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@apple.com>2015-07-20 23:21:30 +0000
committerAkira Hatanaka <ahatanaka@apple.com>2015-07-20 23:21:30 +0000
commit7482d40cd57bbfe173993b9945f5dbece774a9a8 (patch)
tree98c29b0f22fad4fbb8e99468769b35cc123a5023 /llvm/lib/Target/ARM/ARMSubtarget.h
parent6b7fff9ce57f42dbc0f20f8884a210007b201aa6 (diff)
downloadbcm5719-llvm-7482d40cd57bbfe173993b9945f5dbece774a9a8.tar.gz
bcm5719-llvm-7482d40cd57bbfe173993b9945f5dbece774a9a8.zip
[ARM] Define subtarget feature "reserve-r9", which is used to decide
whether register r9 should be reserved. This change is needed because we cannot use a backend option to set cl::opt "arm-reserve-r9" when doing LTO. Out-of-tree projects currently using cl::opt option "-arm-reserve-r9" to reserve r9 should make changes to add subtarget feature "reserve-r9" to the IR. rdar://problem/21529937 Differential Revision: http://reviews.llvm.org/D11320 llvm-svn: 242737
Diffstat (limited to 'llvm/lib/Target/ARM/ARMSubtarget.h')
-rw-r--r--llvm/lib/Target/ARM/ARMSubtarget.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Target/ARM/ARMSubtarget.h b/llvm/lib/Target/ARM/ARMSubtarget.h
index 4f9bc372e4b..b80dc7051f1 100644
--- a/llvm/lib/Target/ARM/ARMSubtarget.h
+++ b/llvm/lib/Target/ARM/ARMSubtarget.h
@@ -109,8 +109,8 @@ protected:
/// NoARM - True if subtarget does not support ARM mode execution.
bool NoARM;
- /// IsR9Reserved - True if R9 is a not available as general purpose register.
- bool IsR9Reserved;
+ /// ReserveR9 - True if R9 is not available as a general purpose register.
+ bool ReserveR9;
/// NoMovt - True if MOVT / MOVW pairs are not used for materialization of
/// 32-bit imms (including global addresses).
@@ -413,7 +413,9 @@ public:
return isThumb1Only() && isMClass();
}
- bool isR9Reserved() const { return IsR9Reserved; }
+ bool isR9Reserved() const {
+ return isTargetMachO() ? (ReserveR9 || !HasV6Ops) : ReserveR9;
+ }
bool useMovt(const MachineFunction &MF) const;
OpenPOWER on IntegriCloud