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 
47  const override;
48 
49  // Get and set the first and last call-saved GPR that should be saved by
50  // this function and the SP offset for the STMG. These are 0 if no GPRs
51  // need to be saved or restored.
52  SystemZ::GPRRegs getSpillGPRRegs() const { return SpillGPRRegs; }
53  void setSpillGPRRegs(Register Low, Register High, unsigned Offs) {
54  SpillGPRRegs.LowGPR = Low;
55  SpillGPRRegs.HighGPR = High;
56  SpillGPRRegs.GPROffset = Offs;
57  }
58 
59  // Get and set the first and last call-saved GPR that should be restored by
60  // this function and the SP offset for the LMG. These are 0 if no GPRs
61  // need to be saved or restored.
62  SystemZ::GPRRegs getRestoreGPRRegs() const { return RestoreGPRRegs; }
63  void setRestoreGPRRegs(Register Low, Register High, unsigned Offs) {
64  RestoreGPRRegs.LowGPR = Low;
65  RestoreGPRRegs.HighGPR = High;
66  RestoreGPRRegs.GPROffset = Offs;
67  }
68 
69  // Get and set the number of fixed (as opposed to variable) arguments
70  // that are passed in GPRs to this function.
71  Register getVarArgsFirstGPR() const { return VarArgsFirstGPR; }
72  void setVarArgsFirstGPR(Register GPR) { VarArgsFirstGPR = GPR; }
73 
74  // Likewise FPRs.
75  Register getVarArgsFirstFPR() const { return VarArgsFirstFPR; }
76  void setVarArgsFirstFPR(Register FPR) { VarArgsFirstFPR = FPR; }
77 
78  // Get and set the frame index of the first stack vararg.
79  unsigned getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
80  void setVarArgsFrameIndex(unsigned FI) { VarArgsFrameIndex = FI; }
81 
82  // Get and set the frame index of the register save area
83  // (i.e. the incoming stack pointer).
84  unsigned getRegSaveFrameIndex() const { return RegSaveFrameIndex; }
85  void setRegSaveFrameIndex(unsigned FI) { RegSaveFrameIndex = FI; }
86 
87  // Get and set the frame index of where the old frame pointer is stored.
88  int getFramePointerSaveIndex() const { return FramePointerSaveIndex; }
89  void setFramePointerSaveIndex(int Idx) { FramePointerSaveIndex = Idx; }
90 
91  // Count number of local-dynamic TLS symbols used.
92  unsigned getNumLocalDynamicTLSAccesses() const { return NumLocalDynamics; }
93  void incNumLocalDynamicTLSAccesses() { ++NumLocalDynamics; }
94 };
95 
96 } // end namespace llvm
97 
98 #endif
llvm::SystemZMachineFunctionInfo::getRegSaveFrameIndex
unsigned getRegSaveFrameIndex() const
Definition: SystemZMachineFunctionInfo.h:84
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::SystemZMachineFunctionInfo::getFramePointerSaveIndex
int getFramePointerSaveIndex() const
Definition: SystemZMachineFunctionInfo.h:88
High
uint64_t High
Definition: NVVMIntrRange.cpp:61
llvm::SystemZMachineFunctionInfo::incNumLocalDynamicTLSAccesses
void incNumLocalDynamicTLSAccesses()
Definition: SystemZMachineFunctionInfo.h:93
FPR
static const MCPhysReg FPR[]
FPR - The set of FP registers that should be allocated for arguments on Darwin and AIX.
Definition: PPCISelLowering.cpp:3872
llvm::SystemZMachineFunctionInfo::getVarArgsFirstGPR
Register getVarArgsFirstGPR() const
Definition: SystemZMachineFunctionInfo.h:71
llvm::SystemZ::GPRRegs
Definition: SystemZMachineFunctionInfo.h:19
llvm::SystemZMachineFunctionInfo::setRestoreGPRRegs
void setRestoreGPRRegs(Register Low, Register High, unsigned Offs)
Definition: SystemZMachineFunctionInfo.h:63
llvm::SystemZ::GPRRegs::GPROffset
unsigned GPROffset
Definition: SystemZMachineFunctionInfo.h:22
llvm::SystemZMachineFunctionInfo::setVarArgsFirstGPR
void setVarArgsFirstGPR(Register GPR)
Definition: SystemZMachineFunctionInfo.h:72
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:62
llvm::SystemZMachineFunctionInfo::setSpillGPRRegs
void setSpillGPRRegs(Register Low, Register High, unsigned Offs)
Definition: SystemZMachineFunctionInfo.h:53
llvm::SystemZMachineFunctionInfo::getNumLocalDynamicTLSAccesses
unsigned getNumLocalDynamicTLSAccesses() const
Definition: SystemZMachineFunctionInfo.h:92
llvm::SystemZMachineFunctionInfo::clone
MachineFunctionInfo * clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF, const DenseMap< MachineBasicBlock *, MachineBasicBlock * > &Src2DstMBB) const override
Make a functionally equivalent copy of this MachineFunctionInfo in MF.
Definition: SystemZMachineFunctionInfo.cpp:17
llvm::BumpPtrAllocatorImpl
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:63
llvm::DenseMap
Definition: DenseMap.h:716
llvm::SystemZMachineFunctionInfo::SystemZMachineFunctionInfo
SystemZMachineFunctionInfo(MachineFunction &MF)
Definition: SystemZMachineFunctionInfo.h:40
llvm::MachineFunction
Definition: MachineFunction.h:257
llvm::SystemZMachineFunctionInfo::getVarArgsFrameIndex
unsigned getVarArgsFrameIndex() const
Definition: SystemZMachineFunctionInfo.h:79
llvm::SystemZMachineFunctionInfo::setVarArgsFrameIndex
void setVarArgsFrameIndex(unsigned FI)
Definition: SystemZMachineFunctionInfo.h:80
llvm::SystemZ::GPRRegs::LowGPR
unsigned LowGPR
Definition: SystemZMachineFunctionInfo.h:20
llvm::SystemZMachineFunctionInfo::setRegSaveFrameIndex
void setRegSaveFrameIndex(unsigned FI)
Definition: SystemZMachineFunctionInfo.h:85
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:52
Allocator
Basic Register Allocator
Definition: RegAllocBasic.cpp:142
llvm::SystemZMachineFunctionInfo::setVarArgsFirstFPR
void setVarArgsFirstFPR(Register FPR)
Definition: SystemZMachineFunctionInfo.h:76
llvm::SystemZMachineFunctionInfo::getVarArgsFirstFPR
Register getVarArgsFirstFPR() const
Definition: SystemZMachineFunctionInfo.h:75
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:89