diff options
author | Sam Parker <sam.parker@arm.com> | 2019-02-08 07:57:42 +0000 |
---|---|---|
committer | Sam Parker <sam.parker@arm.com> | 2019-02-08 07:57:42 +0000 |
commit | 5b09834bc364313e48cc54dccd8f251232d84b65 (patch) | |
tree | 030e669eb5be27f9a814f9c0a6a838d442013542 /llvm/lib/Target/ARM/ARMSubtarget.h | |
parent | 807960e6ef445971756389db7e0c0a001f411720 (diff) | |
download | bcm5719-llvm-5b09834bc364313e48cc54dccd8f251232d84b65.tar.gz bcm5719-llvm-5b09834bc364313e48cc54dccd8f251232d84b65.zip |
[ARM] Add OptMinSize to ARMSubtarget
In many places in the backend, we like to know whether we're
optimising for code size and this is performed by checking the
current machine function attributes. A subtarget is created on a
per-function basis, so it's possible to know when we're compiling for
code size on construction so record this in the new object.
Differential Revision: https://reviews.llvm.org/D57812
llvm-svn: 353501
Diffstat (limited to 'llvm/lib/Target/ARM/ARMSubtarget.h')
-rw-r--r-- | llvm/lib/Target/ARM/ARMSubtarget.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/llvm/lib/Target/ARM/ARMSubtarget.h b/llvm/lib/Target/ARM/ARMSubtarget.h index 240fb600ec6..d2936d3ca72 100644 --- a/llvm/lib/Target/ARM/ARMSubtarget.h +++ b/llvm/lib/Target/ARM/ARMSubtarget.h @@ -445,6 +445,10 @@ protected: /// What alignment is preferred for loop bodies, in log2(bytes). unsigned PrefLoopAlignment = 0; + /// OptMinSize - True if we're optimising for minimum code size, equal to + /// the function attribute. + bool OptMinSize = false; + /// IsLittle - The target is Little Endian bool IsLittle; @@ -467,7 +471,8 @@ public: /// of the specified triple. /// ARMSubtarget(const Triple &TT, const std::string &CPU, const std::string &FS, - const ARMBaseTargetMachine &TM, bool IsLittle); + const ARMBaseTargetMachine &TM, bool IsLittle, + bool MinSize = false); /// getMaxInlineSizeThreshold - Returns the maximum memset / memcpy size /// that still makes it profitable to inline the call. @@ -709,6 +714,7 @@ public: bool disablePostRAScheduler() const { return DisablePostRAScheduler; } bool useSoftFloat() const { return UseSoftFloat; } bool isThumb() const { return InThumbMode; } + bool optForMinSize() const { return OptMinSize; } bool isThumb1Only() const { return InThumbMode && !HasThumb2; } bool isThumb2() const { return InThumbMode && HasThumb2; } bool hasThumb2() const { return HasThumb2; } @@ -735,9 +741,9 @@ public: isThumb1Only(); } - bool useStride4VFPs(const MachineFunction &MF) const; + bool useStride4VFPs() const; - bool useMovt(const MachineFunction &MF) const; + bool useMovt() const; bool supportsTailCall() const { return SupportsTailCall; } |