LLVM  15.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  unsigned NumLocalDynamics;
38 
39 public:
41  : VarArgsFirstGPR(0), VarArgsFirstFPR(0), VarArgsFrameIndex(0),
42  RegSaveFrameIndex(0), FramePointerSaveIndex(0), NumLocalDynamics(0) {}
43 
44  // Get and set the first and last call-saved GPR that should be saved by
45  // this function and the SP offset for the STMG. These are 0 if no GPRs
46  // need to be saved or restored.
47  SystemZ::GPRRegs getSpillGPRRegs() const { return SpillGPRRegs; }
48  void setSpillGPRRegs(Register Low, Register High, unsigned Offs) {
49  SpillGPRRegs.LowGPR = Low;
50  SpillGPRRegs.HighGPR = High;
51  SpillGPRRegs.GPROffset = Offs;
52  }
53 
54  // Get and set the first and last call-saved GPR that should be restored by
55  // this function and the SP offset for the LMG. These are 0 if no GPRs
56  // need to be saved or restored.
57  SystemZ::GPRRegs getRestoreGPRRegs() const { return RestoreGPRRegs; }
58  void setRestoreGPRRegs(Register Low, Register High, unsigned Offs) {
59  RestoreGPRRegs.LowGPR = Low;
60  RestoreGPRRegs.HighGPR = High;
61  RestoreGPRRegs.GPROffset = Offs;
62  }
63 
64  // Get and set the number of fixed (as opposed to variable) arguments
65  // that are passed in GPRs to this function.
66  Register getVarArgsFirstGPR() const { return VarArgsFirstGPR; }
67  void setVarArgsFirstGPR(Register GPR) { VarArgsFirstGPR = GPR; }
68 
69  // Likewise FPRs.
70  Register getVarArgsFirstFPR() const { return VarArgsFirstFPR; }
71  void setVarArgsFirstFPR(Register FPR) { VarArgsFirstFPR = FPR; }
72 
73  // Get and set the frame index of the first stack vararg.
74  unsigned getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
75  void setVarArgsFrameIndex(unsigned FI) { VarArgsFrameIndex = FI; }
76 
77  // Get and set the frame index of the register save area
78  // (i.e. the incoming stack pointer).
79  unsigned getRegSaveFrameIndex() const { return RegSaveFrameIndex; }
80  void setRegSaveFrameIndex(unsigned FI) { RegSaveFrameIndex = FI; }
81 
82  // Get and set the frame index of where the old frame pointer is stored.
83  int getFramePointerSaveIndex() const { return FramePointerSaveIndex; }
84  void setFramePointerSaveIndex(int Idx) { FramePointerSaveIndex = Idx; }
85 
86  // Count number of local-dynamic TLS symbols used.
87  unsigned getNumLocalDynamicTLSAccesses() const { return NumLocalDynamics; }
88  void incNumLocalDynamicTLSAccesses() { ++NumLocalDynamics; }
89 };
90 
91 } // end namespace llvm
92 
93 #endif
llvm::SystemZMachineFunctionInfo::getRegSaveFrameIndex
unsigned getRegSaveFrameIndex() const
Definition: SystemZMachineFunctionInfo.h:79
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::SystemZMachineFunctionInfo::getFramePointerSaveIndex
int getFramePointerSaveIndex() const
Definition: SystemZMachineFunctionInfo.h:83
High
uint64_t High
Definition: NVVMIntrRange.cpp:61
llvm::SystemZMachineFunctionInfo::incNumLocalDynamicTLSAccesses
void incNumLocalDynamicTLSAccesses()
Definition: SystemZMachineFunctionInfo.h:88
FPR
static const MCPhysReg FPR[]
FPR - The set of FP registers that should be allocated for arguments on Darwin and AIX.
Definition: PPCISelLowering.cpp:3868
llvm::SystemZMachineFunctionInfo::getVarArgsFirstGPR
Register getVarArgsFirstGPR() const
Definition: SystemZMachineFunctionInfo.h:66
llvm::SystemZ::GPRRegs
Definition: SystemZMachineFunctionInfo.h:19
llvm::SystemZMachineFunctionInfo::setRestoreGPRRegs
void setRestoreGPRRegs(Register Low, Register High, unsigned Offs)
Definition: SystemZMachineFunctionInfo.h:58
llvm::SystemZ::GPRRegs::GPROffset
unsigned GPROffset
Definition: SystemZMachineFunctionInfo.h:22
llvm::SystemZMachineFunctionInfo::setVarArgsFirstGPR
void setVarArgsFirstGPR(Register GPR)
Definition: SystemZMachineFunctionInfo.h:67
llvm::ThreadPriority::Low
@ Low
Lower the current thread's priority such that it does not affect foreground tasks significantly.
llvm::SystemZMachineFunctionInfo::getRestoreGPRRegs
SystemZ::GPRRegs getRestoreGPRRegs() const
Definition: SystemZMachineFunctionInfo.h:57
llvm::SystemZMachineFunctionInfo::setSpillGPRRegs
void setSpillGPRRegs(Register Low, Register High, unsigned Offs)
Definition: SystemZMachineFunctionInfo.h:48
llvm::SystemZMachineFunctionInfo::getNumLocalDynamicTLSAccesses
unsigned getNumLocalDynamicTLSAccesses() const
Definition: SystemZMachineFunctionInfo.h:87
llvm::SystemZMachineFunctionInfo::SystemZMachineFunctionInfo
SystemZMachineFunctionInfo(MachineFunction &MF)
Definition: SystemZMachineFunctionInfo.h:40
llvm::MachineFunction
Definition: MachineFunction.h:241
llvm::SystemZMachineFunctionInfo::getVarArgsFrameIndex
unsigned getVarArgsFrameIndex() const
Definition: SystemZMachineFunctionInfo.h:74
llvm::SystemZMachineFunctionInfo::setVarArgsFrameIndex
void setVarArgsFrameIndex(unsigned FI)
Definition: SystemZMachineFunctionInfo.h:75
llvm::SystemZ::GPRRegs::LowGPR
unsigned LowGPR
Definition: SystemZMachineFunctionInfo.h:20
llvm::SystemZMachineFunctionInfo::setRegSaveFrameIndex
void setRegSaveFrameIndex(unsigned FI)
Definition: SystemZMachineFunctionInfo.h:80
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:47
llvm::SystemZMachineFunctionInfo::setVarArgsFirstFPR
void setVarArgsFirstFPR(Register FPR)
Definition: SystemZMachineFunctionInfo.h:71
llvm::SystemZMachineFunctionInfo::getVarArgsFirstFPR
Register getVarArgsFirstFPR() const
Definition: SystemZMachineFunctionInfo.h:70
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:84