xref: /freebsd-src/contrib/llvm-project/llvm/lib/Target/ARM/ARMMachineFunctionInfo.h (revision 5f757f3ff9144b609b3c433dfd370cc6bdc191ad)
10b57cec5SDimitry Andric //===-- ARMMachineFunctionInfo.h - ARM machine function info ----*- C++ -*-===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric //
90b57cec5SDimitry Andric // This file declares ARM-specific per-machine-function information.
100b57cec5SDimitry Andric //
110b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
120b57cec5SDimitry Andric 
130b57cec5SDimitry Andric #ifndef LLVM_LIB_TARGET_ARM_ARMMACHINEFUNCTIONINFO_H
140b57cec5SDimitry Andric #define LLVM_LIB_TARGET_ARM_ARMMACHINEFUNCTIONINFO_H
150b57cec5SDimitry Andric 
160b57cec5SDimitry Andric #include "llvm/ADT/DenseMap.h"
170b57cec5SDimitry Andric #include "llvm/ADT/SmallPtrSet.h"
18*5f757f3fSDimitry Andric #include "llvm/CodeGen/MIRYamlMapping.h"
190b57cec5SDimitry Andric #include "llvm/CodeGen/MachineFunction.h"
208bcb0991SDimitry Andric #include "llvm/IR/GlobalVariable.h"
210b57cec5SDimitry Andric #include "llvm/Support/ErrorHandling.h"
220b57cec5SDimitry Andric #include <utility>
230b57cec5SDimitry Andric 
240b57cec5SDimitry Andric namespace llvm {
250b57cec5SDimitry Andric 
26*5f757f3fSDimitry Andric namespace yaml {
27*5f757f3fSDimitry Andric struct ARMFunctionInfo;
28*5f757f3fSDimitry Andric } // end namespace yaml
29*5f757f3fSDimitry Andric 
30bdd1243dSDimitry Andric class ARMSubtarget;
31bdd1243dSDimitry Andric 
320b57cec5SDimitry Andric /// ARMFunctionInfo - This class is derived from MachineFunctionInfo and
330b57cec5SDimitry Andric /// contains private ARM-specific information for each MachineFunction.
340b57cec5SDimitry Andric class ARMFunctionInfo : public MachineFunctionInfo {
350b57cec5SDimitry Andric   virtual void anchor();
360b57cec5SDimitry Andric 
370b57cec5SDimitry Andric   /// isThumb - True if this function is compiled under Thumb mode.
380b57cec5SDimitry Andric   /// Used to initialized Align, so must precede it.
390b57cec5SDimitry Andric   bool isThumb = false;
400b57cec5SDimitry Andric 
410b57cec5SDimitry Andric   /// hasThumb2 - True if the target architecture supports Thumb2. Do not use
420b57cec5SDimitry Andric   /// to determine if function is compiled under Thumb mode, for that use
430b57cec5SDimitry Andric   /// 'isThumb'.
440b57cec5SDimitry Andric   bool hasThumb2 = false;
450b57cec5SDimitry Andric 
46fe6060f1SDimitry Andric   /// ArgsRegSaveSize - Size of the register save area for vararg functions or
47fe6060f1SDimitry Andric   /// those making guaranteed tail calls that need more stack argument space
48fe6060f1SDimitry Andric   /// than is provided by this functions incoming parameters.
490b57cec5SDimitry Andric   ///
500b57cec5SDimitry Andric   unsigned ArgRegsSaveSize = 0;
510b57cec5SDimitry Andric 
520b57cec5SDimitry Andric   /// ReturnRegsCount - Number of registers used up in the return.
530b57cec5SDimitry Andric   unsigned ReturnRegsCount = 0;
540b57cec5SDimitry Andric 
550b57cec5SDimitry Andric   /// HasStackFrame - True if this function has a stack frame. Set by
560b57cec5SDimitry Andric   /// determineCalleeSaves().
570b57cec5SDimitry Andric   bool HasStackFrame = false;
580b57cec5SDimitry Andric 
590b57cec5SDimitry Andric   /// RestoreSPFromFP - True if epilogue should restore SP from FP. Set by
600b57cec5SDimitry Andric   /// emitPrologue.
610b57cec5SDimitry Andric   bool RestoreSPFromFP = false;
620b57cec5SDimitry Andric 
630b57cec5SDimitry Andric   /// LRSpilled - True if the LR register has been for spilled for
640b57cec5SDimitry Andric   /// any reason, so it's legal to emit an ARM::tBfar (i.e. "bl").
650b57cec5SDimitry Andric   bool LRSpilled = false;
660b57cec5SDimitry Andric 
670b57cec5SDimitry Andric   /// FramePtrSpillOffset - If HasStackFrame, this records the frame pointer
680b57cec5SDimitry Andric   /// spill stack offset.
690b57cec5SDimitry Andric   unsigned FramePtrSpillOffset = 0;
700b57cec5SDimitry Andric 
710b57cec5SDimitry Andric   /// GPRCS1Offset, GPRCS2Offset, DPRCSOffset - Starting offset of callee saved
720b57cec5SDimitry Andric   /// register spills areas. For Mac OS X:
730b57cec5SDimitry Andric   ///
740b57cec5SDimitry Andric   /// GPR callee-saved (1) : r4, r5, r6, r7, lr
750b57cec5SDimitry Andric   /// --------------------------------------------
760b57cec5SDimitry Andric   /// GPR callee-saved (2) : r8, r10, r11
770b57cec5SDimitry Andric   /// --------------------------------------------
780b57cec5SDimitry Andric   /// DPR callee-saved : d8 - d15
790b57cec5SDimitry Andric   ///
800b57cec5SDimitry Andric   /// Also see AlignedDPRCSRegs below. Not all D-regs need to go in area 3.
810b57cec5SDimitry Andric   /// Some may be spilled after the stack has been realigned.
820b57cec5SDimitry Andric   unsigned GPRCS1Offset = 0;
830b57cec5SDimitry Andric   unsigned GPRCS2Offset = 0;
840b57cec5SDimitry Andric   unsigned DPRCSOffset = 0;
850b57cec5SDimitry Andric 
860b57cec5SDimitry Andric   /// GPRCS1Size, GPRCS2Size, DPRCSSize - Sizes of callee saved register spills
870b57cec5SDimitry Andric   /// areas.
885ffd83dbSDimitry Andric   unsigned FPCXTSaveSize = 0;
8981ad6265SDimitry Andric   unsigned FRSaveSize = 0;
900b57cec5SDimitry Andric   unsigned GPRCS1Size = 0;
910b57cec5SDimitry Andric   unsigned GPRCS2Size = 0;
920b57cec5SDimitry Andric   unsigned DPRCSAlignGapSize = 0;
930b57cec5SDimitry Andric   unsigned DPRCSSize = 0;
940b57cec5SDimitry Andric 
950b57cec5SDimitry Andric   /// NumAlignedDPRCS2Regs - The number of callee-saved DPRs that are saved in
960b57cec5SDimitry Andric   /// the aligned portion of the stack frame.  This is always a contiguous
970b57cec5SDimitry Andric   /// sequence of D-registers starting from d8.
980b57cec5SDimitry Andric   ///
990b57cec5SDimitry Andric   /// We do not keep track of the frame indices used for these registers - they
1000b57cec5SDimitry Andric   /// behave like any other frame index in the aligned stack frame.  These
1010b57cec5SDimitry Andric   /// registers also aren't included in DPRCSSize above.
1020b57cec5SDimitry Andric   unsigned NumAlignedDPRCS2Regs = 0;
1030b57cec5SDimitry Andric 
1040b57cec5SDimitry Andric   unsigned PICLabelUId = 0;
1050b57cec5SDimitry Andric 
1060b57cec5SDimitry Andric   /// VarArgsFrameIndex - FrameIndex for start of varargs area.
1070b57cec5SDimitry Andric   int VarArgsFrameIndex = 0;
1080b57cec5SDimitry Andric 
1090b57cec5SDimitry Andric   /// HasITBlocks - True if IT blocks have been inserted.
1100b57cec5SDimitry Andric   bool HasITBlocks = false;
1110b57cec5SDimitry Andric 
1125ffd83dbSDimitry Andric   // Security Extensions
1135ffd83dbSDimitry Andric   bool IsCmseNSEntry;
1145ffd83dbSDimitry Andric   bool IsCmseNSCall;
1155ffd83dbSDimitry Andric 
1160b57cec5SDimitry Andric   /// CPEClones - Track constant pool entries clones created by Constant Island
1170b57cec5SDimitry Andric   /// pass.
1180b57cec5SDimitry Andric   DenseMap<unsigned, unsigned> CPEClones;
1190b57cec5SDimitry Andric 
1200b57cec5SDimitry Andric   /// ArgumentStackSize - amount of bytes on stack consumed by the arguments
1210b57cec5SDimitry Andric   /// being passed on the stack
1220b57cec5SDimitry Andric   unsigned ArgumentStackSize = 0;
1230b57cec5SDimitry Andric 
124fe6060f1SDimitry Andric   /// ArgumentStackToRestore - amount of bytes on stack consumed that we must
125fe6060f1SDimitry Andric   /// restore on return.
126fe6060f1SDimitry Andric   unsigned ArgumentStackToRestore = 0;
127fe6060f1SDimitry Andric 
1280b57cec5SDimitry Andric   /// CoalescedWeights - mapping of basic blocks to the rolling counter of
1290b57cec5SDimitry Andric   /// coalesced weights.
1300b57cec5SDimitry Andric   DenseMap<const MachineBasicBlock*, unsigned> CoalescedWeights;
1310b57cec5SDimitry Andric 
1320b57cec5SDimitry Andric   /// True if this function has a subset of CSRs that is handled explicitly via
1330b57cec5SDimitry Andric   /// copies.
1340b57cec5SDimitry Andric   bool IsSplitCSR = false;
1350b57cec5SDimitry Andric 
1360b57cec5SDimitry Andric   /// Globals that have had their storage promoted into the constant pool.
1370b57cec5SDimitry Andric   SmallPtrSet<const GlobalVariable*,2> PromotedGlobals;
1380b57cec5SDimitry Andric 
1390b57cec5SDimitry Andric   /// The amount the literal pool has been increasedby due to promoted globals.
1400b57cec5SDimitry Andric   int PromotedGlobalsIncrease = 0;
1410b57cec5SDimitry Andric 
1428bcb0991SDimitry Andric   /// True if r0 will be preserved by a call to this function (e.g. C++
1438bcb0991SDimitry Andric   /// con/destructors).
1448bcb0991SDimitry Andric   bool PreservesR0 = false;
1458bcb0991SDimitry Andric 
1464824e7fdSDimitry Andric   /// True if the function should sign its return address.
1474824e7fdSDimitry Andric   bool SignReturnAddress = false;
1484824e7fdSDimitry Andric 
1494824e7fdSDimitry Andric   /// True if the fucntion should sign its return address, even if LR is not
1504824e7fdSDimitry Andric   /// saved.
1514824e7fdSDimitry Andric   bool SignReturnAddressAll = false;
1524824e7fdSDimitry Andric 
1534824e7fdSDimitry Andric   /// True if BTI instructions should be placed at potential indirect jump
1544824e7fdSDimitry Andric   /// destinations.
1554824e7fdSDimitry Andric   bool BranchTargetEnforcement = false;
1564824e7fdSDimitry Andric 
1570b57cec5SDimitry Andric public:
1580b57cec5SDimitry Andric   ARMFunctionInfo() = default;
1590b57cec5SDimitry Andric 
160bdd1243dSDimitry Andric   explicit ARMFunctionInfo(const Function &F, const ARMSubtarget *STI);
1610b57cec5SDimitry Andric 
16281ad6265SDimitry Andric   MachineFunctionInfo *
16381ad6265SDimitry Andric   clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF,
16481ad6265SDimitry Andric         const DenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB)
16581ad6265SDimitry Andric       const override;
16681ad6265SDimitry Andric 
isThumbFunction()1670b57cec5SDimitry Andric   bool isThumbFunction() const { return isThumb; }
isThumb1OnlyFunction()1680b57cec5SDimitry Andric   bool isThumb1OnlyFunction() const { return isThumb && !hasThumb2; }
isThumb2Function()1690b57cec5SDimitry Andric   bool isThumb2Function() const { return isThumb && hasThumb2; }
1700b57cec5SDimitry Andric 
isCmseNSEntryFunction()1715ffd83dbSDimitry Andric   bool isCmseNSEntryFunction() const { return IsCmseNSEntry; }
isCmseNSCallFunction()1725ffd83dbSDimitry Andric   bool isCmseNSCallFunction() const { return IsCmseNSCall; }
1735ffd83dbSDimitry Andric 
getArgRegsSaveSize()1740b57cec5SDimitry Andric   unsigned getArgRegsSaveSize() const { return ArgRegsSaveSize; }
setArgRegsSaveSize(unsigned s)1750b57cec5SDimitry Andric   void setArgRegsSaveSize(unsigned s) { ArgRegsSaveSize = s; }
1760b57cec5SDimitry Andric 
getReturnRegsCount()1770b57cec5SDimitry Andric   unsigned getReturnRegsCount() const { return ReturnRegsCount; }
setReturnRegsCount(unsigned s)1780b57cec5SDimitry Andric   void setReturnRegsCount(unsigned s) { ReturnRegsCount = s; }
1790b57cec5SDimitry Andric 
hasStackFrame()1800b57cec5SDimitry Andric   bool hasStackFrame() const { return HasStackFrame; }
setHasStackFrame(bool s)1810b57cec5SDimitry Andric   void setHasStackFrame(bool s) { HasStackFrame = s; }
1820b57cec5SDimitry Andric 
shouldRestoreSPFromFP()1830b57cec5SDimitry Andric   bool shouldRestoreSPFromFP() const { return RestoreSPFromFP; }
setShouldRestoreSPFromFP(bool s)1840b57cec5SDimitry Andric   void setShouldRestoreSPFromFP(bool s) { RestoreSPFromFP = s; }
1850b57cec5SDimitry Andric 
isLRSpilled()1860b57cec5SDimitry Andric   bool isLRSpilled() const { return LRSpilled; }
setLRIsSpilled(bool s)1870b57cec5SDimitry Andric   void setLRIsSpilled(bool s) { LRSpilled = s; }
1880b57cec5SDimitry Andric 
getFramePtrSpillOffset()1890b57cec5SDimitry Andric   unsigned getFramePtrSpillOffset() const { return FramePtrSpillOffset; }
setFramePtrSpillOffset(unsigned o)1900b57cec5SDimitry Andric   void setFramePtrSpillOffset(unsigned o) { FramePtrSpillOffset = o; }
1910b57cec5SDimitry Andric 
getNumAlignedDPRCS2Regs()1920b57cec5SDimitry Andric   unsigned getNumAlignedDPRCS2Regs() const { return NumAlignedDPRCS2Regs; }
setNumAlignedDPRCS2Regs(unsigned n)1930b57cec5SDimitry Andric   void setNumAlignedDPRCS2Regs(unsigned n) { NumAlignedDPRCS2Regs = n; }
1940b57cec5SDimitry Andric 
getGPRCalleeSavedArea1Offset()1950b57cec5SDimitry Andric   unsigned getGPRCalleeSavedArea1Offset() const { return GPRCS1Offset; }
getGPRCalleeSavedArea2Offset()1960b57cec5SDimitry Andric   unsigned getGPRCalleeSavedArea2Offset() const { return GPRCS2Offset; }
getDPRCalleeSavedAreaOffset()1970b57cec5SDimitry Andric   unsigned getDPRCalleeSavedAreaOffset()  const { return DPRCSOffset; }
1980b57cec5SDimitry Andric 
setGPRCalleeSavedArea1Offset(unsigned o)1990b57cec5SDimitry Andric   void setGPRCalleeSavedArea1Offset(unsigned o) { GPRCS1Offset = o; }
setGPRCalleeSavedArea2Offset(unsigned o)2000b57cec5SDimitry Andric   void setGPRCalleeSavedArea2Offset(unsigned o) { GPRCS2Offset = o; }
setDPRCalleeSavedAreaOffset(unsigned o)2010b57cec5SDimitry Andric   void setDPRCalleeSavedAreaOffset(unsigned o)  { DPRCSOffset = o; }
2020b57cec5SDimitry Andric 
getFPCXTSaveAreaSize()2035ffd83dbSDimitry Andric   unsigned getFPCXTSaveAreaSize() const       { return FPCXTSaveSize; }
getFrameRecordSavedAreaSize()20481ad6265SDimitry Andric   unsigned getFrameRecordSavedAreaSize() const { return FRSaveSize; }
getGPRCalleeSavedArea1Size()2050b57cec5SDimitry Andric   unsigned getGPRCalleeSavedArea1Size() const { return GPRCS1Size; }
getGPRCalleeSavedArea2Size()2060b57cec5SDimitry Andric   unsigned getGPRCalleeSavedArea2Size() const { return GPRCS2Size; }
getDPRCalleeSavedGapSize()2070b57cec5SDimitry Andric   unsigned getDPRCalleeSavedGapSize() const   { return DPRCSAlignGapSize; }
getDPRCalleeSavedAreaSize()2080b57cec5SDimitry Andric   unsigned getDPRCalleeSavedAreaSize()  const { return DPRCSSize; }
2090b57cec5SDimitry Andric 
setFPCXTSaveAreaSize(unsigned s)2105ffd83dbSDimitry Andric   void setFPCXTSaveAreaSize(unsigned s)       { FPCXTSaveSize = s; }
setFrameRecordSavedAreaSize(unsigned s)21181ad6265SDimitry Andric   void setFrameRecordSavedAreaSize(unsigned s) { FRSaveSize = s; }
setGPRCalleeSavedArea1Size(unsigned s)2120b57cec5SDimitry Andric   void setGPRCalleeSavedArea1Size(unsigned s) { GPRCS1Size = s; }
setGPRCalleeSavedArea2Size(unsigned s)2130b57cec5SDimitry Andric   void setGPRCalleeSavedArea2Size(unsigned s) { GPRCS2Size = s; }
setDPRCalleeSavedGapSize(unsigned s)2140b57cec5SDimitry Andric   void setDPRCalleeSavedGapSize(unsigned s)   { DPRCSAlignGapSize = s; }
setDPRCalleeSavedAreaSize(unsigned s)2150b57cec5SDimitry Andric   void setDPRCalleeSavedAreaSize(unsigned s)  { DPRCSSize = s; }
2160b57cec5SDimitry Andric 
getArgumentStackSize()2170b57cec5SDimitry Andric   unsigned getArgumentStackSize() const { return ArgumentStackSize; }
setArgumentStackSize(unsigned size)2180b57cec5SDimitry Andric   void setArgumentStackSize(unsigned size) { ArgumentStackSize = size; }
2190b57cec5SDimitry Andric 
getArgumentStackToRestore()220fe6060f1SDimitry Andric   unsigned getArgumentStackToRestore() const { return ArgumentStackToRestore; }
setArgumentStackToRestore(unsigned v)221fe6060f1SDimitry Andric   void setArgumentStackToRestore(unsigned v) { ArgumentStackToRestore = v; }
222fe6060f1SDimitry Andric 
initPICLabelUId(unsigned UId)2230b57cec5SDimitry Andric   void initPICLabelUId(unsigned UId) {
2240b57cec5SDimitry Andric     PICLabelUId = UId;
2250b57cec5SDimitry Andric   }
2260b57cec5SDimitry Andric 
getNumPICLabels()2270b57cec5SDimitry Andric   unsigned getNumPICLabels() const {
2280b57cec5SDimitry Andric     return PICLabelUId;
2290b57cec5SDimitry Andric   }
2300b57cec5SDimitry Andric 
createPICLabelUId()2310b57cec5SDimitry Andric   unsigned createPICLabelUId() {
2320b57cec5SDimitry Andric     return PICLabelUId++;
2330b57cec5SDimitry Andric   }
2340b57cec5SDimitry Andric 
getVarArgsFrameIndex()2350b57cec5SDimitry Andric   int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
setVarArgsFrameIndex(int Index)2360b57cec5SDimitry Andric   void setVarArgsFrameIndex(int Index) { VarArgsFrameIndex = Index; }
2370b57cec5SDimitry Andric 
hasITBlocks()2380b57cec5SDimitry Andric   bool hasITBlocks() const { return HasITBlocks; }
setHasITBlocks(bool h)2390b57cec5SDimitry Andric   void setHasITBlocks(bool h) { HasITBlocks = h; }
2400b57cec5SDimitry Andric 
isSplitCSR()2410b57cec5SDimitry Andric   bool isSplitCSR() const { return IsSplitCSR; }
setIsSplitCSR(bool s)2420b57cec5SDimitry Andric   void setIsSplitCSR(bool s) { IsSplitCSR = s; }
2430b57cec5SDimitry Andric 
recordCPEClone(unsigned CPIdx,unsigned CPCloneIdx)2440b57cec5SDimitry Andric   void recordCPEClone(unsigned CPIdx, unsigned CPCloneIdx) {
2450b57cec5SDimitry Andric     if (!CPEClones.insert(std::make_pair(CPCloneIdx, CPIdx)).second)
2460b57cec5SDimitry Andric       llvm_unreachable("Duplicate entries!");
2470b57cec5SDimitry Andric   }
2480b57cec5SDimitry Andric 
getOriginalCPIdx(unsigned CloneIdx)2490b57cec5SDimitry Andric   unsigned getOriginalCPIdx(unsigned CloneIdx) const {
2500b57cec5SDimitry Andric     DenseMap<unsigned, unsigned>::const_iterator I = CPEClones.find(CloneIdx);
2510b57cec5SDimitry Andric     if (I != CPEClones.end())
2520b57cec5SDimitry Andric       return I->second;
2530b57cec5SDimitry Andric     else
2540b57cec5SDimitry Andric       return -1U;
2550b57cec5SDimitry Andric   }
2560b57cec5SDimitry Andric 
getCoalescedWeight(MachineBasicBlock * MBB)2570b57cec5SDimitry Andric   DenseMap<const MachineBasicBlock*, unsigned>::iterator getCoalescedWeight(
2580b57cec5SDimitry Andric                                                   MachineBasicBlock* MBB) {
2590b57cec5SDimitry Andric     auto It = CoalescedWeights.find(MBB);
2600b57cec5SDimitry Andric     if (It == CoalescedWeights.end()) {
2610b57cec5SDimitry Andric       It = CoalescedWeights.insert(std::make_pair(MBB, 0)).first;
2620b57cec5SDimitry Andric     }
2630b57cec5SDimitry Andric     return It;
2640b57cec5SDimitry Andric   }
2650b57cec5SDimitry Andric 
2660b57cec5SDimitry Andric   /// Indicate to the backend that \c GV has had its storage changed to inside
2670b57cec5SDimitry Andric   /// a constant pool. This means it no longer needs to be emitted as a
2680b57cec5SDimitry Andric   /// global variable.
markGlobalAsPromotedToConstantPool(const GlobalVariable * GV)2690b57cec5SDimitry Andric   void markGlobalAsPromotedToConstantPool(const GlobalVariable *GV) {
2700b57cec5SDimitry Andric     PromotedGlobals.insert(GV);
2710b57cec5SDimitry Andric   }
getGlobalsPromotedToConstantPool()2720b57cec5SDimitry Andric   SmallPtrSet<const GlobalVariable*, 2>& getGlobalsPromotedToConstantPool() {
2730b57cec5SDimitry Andric     return PromotedGlobals;
2740b57cec5SDimitry Andric   }
getPromotedConstpoolIncrease()2750b57cec5SDimitry Andric   int getPromotedConstpoolIncrease() const {
2760b57cec5SDimitry Andric     return PromotedGlobalsIncrease;
2770b57cec5SDimitry Andric   }
setPromotedConstpoolIncrease(int Sz)2780b57cec5SDimitry Andric   void setPromotedConstpoolIncrease(int Sz) {
2790b57cec5SDimitry Andric     PromotedGlobalsIncrease = Sz;
2800b57cec5SDimitry Andric   }
2810b57cec5SDimitry Andric 
2820b57cec5SDimitry Andric   DenseMap<unsigned, unsigned> EHPrologueRemappedRegs;
2835ffd83dbSDimitry Andric   DenseMap<unsigned, unsigned> EHPrologueOffsetInRegs;
2848bcb0991SDimitry Andric 
setPreservesR0()2858bcb0991SDimitry Andric   void setPreservesR0() { PreservesR0 = true; }
getPreservesR0()2868bcb0991SDimitry Andric   bool getPreservesR0() const { return PreservesR0; }
2874824e7fdSDimitry Andric 
shouldSignReturnAddress()2884824e7fdSDimitry Andric   bool shouldSignReturnAddress() const {
2894824e7fdSDimitry Andric     return shouldSignReturnAddress(LRSpilled);
2904824e7fdSDimitry Andric   }
2914824e7fdSDimitry Andric 
shouldSignReturnAddress(bool SpillsLR)2924824e7fdSDimitry Andric   bool shouldSignReturnAddress(bool SpillsLR) const {
2934824e7fdSDimitry Andric     if (!SignReturnAddress)
2944824e7fdSDimitry Andric       return false;
2954824e7fdSDimitry Andric     if (SignReturnAddressAll)
2964824e7fdSDimitry Andric       return true;
2970eae32dcSDimitry Andric     return SpillsLR;
2984824e7fdSDimitry Andric   }
2994824e7fdSDimitry Andric 
branchTargetEnforcement()3004824e7fdSDimitry Andric   bool branchTargetEnforcement() const { return BranchTargetEnforcement; }
301*5f757f3fSDimitry Andric 
302*5f757f3fSDimitry Andric   void initializeBaseYamlFields(const yaml::ARMFunctionInfo &YamlMFI);
3030b57cec5SDimitry Andric };
3040b57cec5SDimitry Andric 
305*5f757f3fSDimitry Andric namespace yaml {
306*5f757f3fSDimitry Andric struct ARMFunctionInfo final : public yaml::MachineFunctionInfo {
307*5f757f3fSDimitry Andric   bool LRSpilled;
308*5f757f3fSDimitry Andric 
309*5f757f3fSDimitry Andric   ARMFunctionInfo() = default;
310*5f757f3fSDimitry Andric   ARMFunctionInfo(const llvm::ARMFunctionInfo &MFI);
311*5f757f3fSDimitry Andric 
312*5f757f3fSDimitry Andric   void mappingImpl(yaml::IO &YamlIO) override;
313*5f757f3fSDimitry Andric   ~ARMFunctionInfo() = default;
314*5f757f3fSDimitry Andric };
315*5f757f3fSDimitry Andric 
316*5f757f3fSDimitry Andric template <> struct MappingTraits<ARMFunctionInfo> {
317*5f757f3fSDimitry Andric   static void mapping(IO &YamlIO, ARMFunctionInfo &MFI) {
318*5f757f3fSDimitry Andric     YamlIO.mapOptional("isLRSpilled", MFI.LRSpilled);
319*5f757f3fSDimitry Andric   }
320*5f757f3fSDimitry Andric };
321*5f757f3fSDimitry Andric 
322*5f757f3fSDimitry Andric } // end namespace yaml
323*5f757f3fSDimitry Andric 
3240b57cec5SDimitry Andric } // end namespace llvm
3250b57cec5SDimitry Andric 
3260b57cec5SDimitry Andric #endif // LLVM_LIB_TARGET_ARM_ARMMACHINEFUNCTIONINFO_H
327