LLVM  14.0.0git
SystemZMachineFunctionInfo.h
Go to the documentation of this file.
1 //=== SystemZMachineFunctionInfo.h - SystemZ machine function info -*- C++ -*-//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZMACHINEFUNCTIONINFO_H
10 #define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZMACHINEFUNCTIONINFO_H
11 
13 
14 namespace llvm {
15 
16 namespace SystemZ {
17 // A struct to hold the low and high GPR registers to be saved/restored as
18 // well as the offset into the register save area of the low register.
19 struct GPRRegs {
20  unsigned LowGPR;
21  unsigned HighGPR;
22  unsigned GPROffset;
23  GPRRegs() : LowGPR(0), HighGPR(0), GPROffset(0) {}
24  };
25 }
26 
28  virtual void anchor();
29 
30  SystemZ::GPRRegs SpillGPRRegs;
31  SystemZ::GPRRegs RestoreGPRRegs;
32  Register VarArgsFirstGPR;
33  Register VarArgsFirstFPR;
34  unsigned VarArgsFrameIndex;
35  unsigned RegSaveFrameIndex;
36  int FramePointerSaveIndex;
37  bool ManipulatesSP;
38  unsigned NumLocalDynamics;
39 
40 public:
42  : VarArgsFirstGPR(0), VarArgsFirstFPR(0), VarArgsFrameIndex(0),
43  RegSaveFrameIndex(0), FramePointerSaveIndex(0), ManipulatesSP(false),
44  NumLocalDynamics(0) {}
45 
46  // Get and set the first and last call-saved GPR that should be saved by
47  // this function and the SP offset for the STMG. These are 0 if no GPRs
48  // need to be saved or restored.
49  SystemZ::GPRRegs getSpillGPRRegs() const { return SpillGPRRegs; }
50  void setSpillGPRRegs(Register Low, Register High, unsigned Offs) {
51  SpillGPRRegs.LowGPR = Low;
52  SpillGPRRegs.HighGPR = High;
53  SpillGPRRegs.GPROffset = Offs;
54  }
55 
56  // Get and set the first and last call-saved GPR that should be restored by
57  // this function and the SP offset for the LMG. These are 0 if no GPRs
58  // need to be saved or restored.
59  SystemZ::GPRRegs getRestoreGPRRegs() const { return RestoreGPRRegs; }
60  void setRestoreGPRRegs(Register Low, Register High, unsigned Offs) {
61  RestoreGPRRegs.LowGPR = Low;
62  RestoreGPRRegs.HighGPR = High;
63  RestoreGPRRegs.GPROffset = Offs;
64  }
65 
66  // Get and set the number of fixed (as opposed to variable) arguments
67  // that are passed in GPRs to this function.
68  Register getVarArgsFirstGPR() const { return VarArgsFirstGPR; }
69  void setVarArgsFirstGPR(Register GPR) { VarArgsFirstGPR = GPR; }
70 
71  // Likewise FPRs.
72  Register getVarArgsFirstFPR() const { return VarArgsFirstFPR; }
73  void setVarArgsFirstFPR(Register FPR) { VarArgsFirstFPR = FPR; }
74 
75  // Get and set the frame index of the first stack vararg.
76  unsigned getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
77  void setVarArgsFrameIndex(unsigned FI) { VarArgsFrameIndex = FI; }
78 
79  // Get and set the frame index of the register save area
80  // (i.e. the incoming stack pointer).
81  unsigned getRegSaveFrameIndex() const { return RegSaveFrameIndex; }
82  void setRegSaveFrameIndex(unsigned FI) { RegSaveFrameIndex = FI; }
83 
84  // Get and set the frame index of where the old frame pointer is stored.
85  int getFramePointerSaveIndex() const { return FramePointerSaveIndex; }
86  void setFramePointerSaveIndex(int Idx) { FramePointerSaveIndex = Idx; }
87 
88  // Get and set whether the function directly manipulates the stack pointer,
89  // e.g. through STACKSAVE or STACKRESTORE.
90  bool getManipulatesSP() const { return ManipulatesSP; }
91  void setManipulatesSP(bool MSP) { ManipulatesSP = MSP; }
92 
93  // Count number of local-dynamic TLS symbols used.
94  unsigned getNumLocalDynamicTLSAccesses() const { return NumLocalDynamics; }
95  void incNumLocalDynamicTLSAccesses() { ++NumLocalDynamics; }
96 };
97 
98 } // end namespace llvm
99 
100 #endif
llvm::SystemZMachineFunctionInfo::getRegSaveFrameIndex
unsigned getRegSaveFrameIndex() const
Definition: SystemZMachineFunctionInfo.h:81
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::SystemZMachineFunctionInfo::getFramePointerSaveIndex
int getFramePointerSaveIndex() const
Definition: SystemZMachineFunctionInfo.h:85
High
uint64_t High
Definition: NVVMIntrRange.cpp:61
llvm::SystemZMachineFunctionInfo::incNumLocalDynamicTLSAccesses
void incNumLocalDynamicTLSAccesses()
Definition: SystemZMachineFunctionInfo.h:95
FPR
static const MCPhysReg FPR[]
FPR - The set of FP registers that should be allocated for arguments on Darwin and AIX.
Definition: PPCISelLowering.cpp:3822
llvm::SystemZMachineFunctionInfo::getVarArgsFirstGPR
Register getVarArgsFirstGPR() const
Definition: SystemZMachineFunctionInfo.h:68
llvm::SystemZ::GPRRegs
Definition: SystemZMachineFunctionInfo.h:19
llvm::SystemZMachineFunctionInfo::setRestoreGPRRegs
void setRestoreGPRRegs(Register Low, Register High, unsigned Offs)
Definition: SystemZMachineFunctionInfo.h:60
llvm::SystemZ::GPRRegs::GPROffset
unsigned GPROffset
Definition: SystemZMachineFunctionInfo.h:22
llvm::SystemZMachineFunctionInfo::setVarArgsFirstGPR
void setVarArgsFirstGPR(Register GPR)
Definition: SystemZMachineFunctionInfo.h:69
false
Definition: StackSlotColoring.cpp:142
llvm::SystemZMachineFunctionInfo::getRestoreGPRRegs
SystemZ::GPRRegs getRestoreGPRRegs() const
Definition: SystemZMachineFunctionInfo.h:59
llvm::SystemZMachineFunctionInfo::setSpillGPRRegs
void setSpillGPRRegs(Register Low, Register High, unsigned Offs)
Definition: SystemZMachineFunctionInfo.h:50
llvm::SystemZMachineFunctionInfo::getNumLocalDynamicTLSAccesses
unsigned getNumLocalDynamicTLSAccesses() const
Definition: SystemZMachineFunctionInfo.h:94
llvm::SystemZMachineFunctionInfo::setManipulatesSP
void setManipulatesSP(bool MSP)
Definition: SystemZMachineFunctionInfo.h:91
llvm::SystemZMachineFunctionInfo::SystemZMachineFunctionInfo
SystemZMachineFunctionInfo(MachineFunction &MF)
Definition: SystemZMachineFunctionInfo.h:41
llvm::SystemZMachineFunctionInfo::getManipulatesSP
bool getManipulatesSP() const
Definition: SystemZMachineFunctionInfo.h:90
llvm::MachineFunction
Definition: MachineFunction.h:230
llvm::SystemZMachineFunctionInfo::getVarArgsFrameIndex
unsigned getVarArgsFrameIndex() const
Definition: SystemZMachineFunctionInfo.h:76
llvm::SystemZMachineFunctionInfo::setVarArgsFrameIndex
void setVarArgsFrameIndex(unsigned FI)
Definition: SystemZMachineFunctionInfo.h:77
llvm::SystemZ::GPRRegs::LowGPR
unsigned LowGPR
Definition: SystemZMachineFunctionInfo.h:20
llvm::SystemZMachineFunctionInfo::setRegSaveFrameIndex
void setRegSaveFrameIndex(unsigned FI)
Definition: SystemZMachineFunctionInfo.h:82
llvm::Register
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
llvm::SystemZ::GPRRegs::GPRRegs
GPRRegs()
Definition: SystemZMachineFunctionInfo.h:23
llvm::SystemZMachineFunctionInfo
Definition: SystemZMachineFunctionInfo.h:27
llvm::SystemZMachineFunctionInfo::getSpillGPRRegs
SystemZ::GPRRegs getSpillGPRRegs() const
Definition: SystemZMachineFunctionInfo.h:49
llvm::SystemZMachineFunctionInfo::setVarArgsFirstFPR
void setVarArgsFirstFPR(Register FPR)
Definition: SystemZMachineFunctionInfo.h:73
llvm::SystemZMachineFunctionInfo::getVarArgsFirstFPR
Register getVarArgsFirstFPR() const
Definition: SystemZMachineFunctionInfo.h:72
MachineFunction.h
llvm::SystemZ::GPRRegs::HighGPR
unsigned HighGPR
Definition: SystemZMachineFunctionInfo.h:21
llvm::MachineFunctionInfo
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
Definition: MachineFunction.h:95
llvm::SystemZMachineFunctionInfo::setFramePointerSaveIndex
void setFramePointerSaveIndex(int Idx)
Definition: SystemZMachineFunctionInfo.h:86