diff options
author | John Baldwin <jhb@FreeBSD.org> | 2017-08-14 21:49:38 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2017-08-14 21:49:38 +0000 |
commit | 1255b165bf03786a6acb326150d0068f09d0bffb (patch) | |
tree | cecc450d9afc92ada572580075716b7bdeb1f24c /llvm/lib/Target/Mips/MipsSubtarget.h | |
parent | 1c617be0541e9c88500f9e2aae49a9d24f6920a3 (diff) | |
download | bcm5719-llvm-1255b165bf03786a6acb326150d0068f09d0bffb.tar.gz bcm5719-llvm-1255b165bf03786a6acb326150d0068f09d0bffb.zip |
[MIPS] Implement support for -mstack-alignment.
Summary:
This is modeled on the implementation for x86 which stores the command line
option in a 'StackAlignOverride' field in MipsSubtarget and then uses this
to compute a 'stackAlignment' value in
MipsSubtarget::initializeSubtargetDependencies.
The stackAlignment() method in MipsSubTarget is renamed to getStackAlignment()
and returns the computed 'stackAlignment'.
Reviewers: sdardis
Reviewed By: sdardis
Subscribers: llvm-commits, arichardson
Differential Revision: https://reviews.llvm.org/D35874
llvm-svn: 310891
Diffstat (limited to 'llvm/lib/Target/Mips/MipsSubtarget.h')
-rw-r--r-- | llvm/lib/Target/Mips/MipsSubtarget.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/llvm/lib/Target/Mips/MipsSubtarget.h b/llvm/lib/Target/Mips/MipsSubtarget.h index ef04c931138..0c9688865c1 100644 --- a/llvm/lib/Target/Mips/MipsSubtarget.h +++ b/llvm/lib/Target/Mips/MipsSubtarget.h @@ -155,6 +155,13 @@ class MipsSubtarget : public MipsGenSubtargetInfo { // Disable use of the `jal` instruction. bool UseLongCalls = false; + /// The minimum alignment known to hold of the stack frame on + /// entry to the function and which must be maintained by every function. + unsigned stackAlignment; + + /// The overridden stack alignment. + unsigned StackAlignOverride; + InstrItineraryData InstrItins; // We can override the determination of whether we are in mips16 mode @@ -186,7 +193,7 @@ public: /// This constructor initializes the data members to match that /// of the specified triple. MipsSubtarget(const Triple &TT, StringRef CPU, StringRef FS, bool little, - const MipsTargetMachine &TM); + const MipsTargetMachine &TM, unsigned StackAlignOverride); /// ParseSubtargetFeatures - Parses features string setting specified /// subtarget options. Definition of function is auto generated by tblgen. @@ -295,9 +302,7 @@ public: // really use them if in addition we are in mips16 mode static bool useConstantIslands(); - unsigned stackAlignment() const { - return isABI_N32() || isABI_N64() ? 16 : 8; - } + unsigned getStackAlignment() const { return stackAlignment; } // Grab relocation model Reloc::Model getRelocationModel() const; |