LLVM 19.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
14namespace llvm {
15
16namespace 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.
19struct GPRRegs {
20 unsigned LowGPR = 0;
21 unsigned HighGPR = 0;
22 unsigned GPROffset = 0;
23 GPRRegs() = default;
24 };
25}
26
28 virtual void anchor();
29
30 /// Size of expected parameter area for current function. (Fixed args only).
31 unsigned SizeOfFnParams;
32
33 SystemZ::GPRRegs SpillGPRRegs;
34 SystemZ::GPRRegs RestoreGPRRegs;
35 Register VarArgsFirstGPR;
36 Register VarArgsFirstFPR;
37 unsigned VarArgsFrameIndex;
38 unsigned RegSaveFrameIndex;
39 int FramePointerSaveIndex;
40 unsigned NumLocalDynamics;
41 /// z/OS XPLINK ABI: incoming ADA virtual register.
42 Register VRegADA;
43
44public:
46 : SizeOfFnParams(0), VarArgsFirstGPR(0), VarArgsFirstFPR(0),
47 VarArgsFrameIndex(0), RegSaveFrameIndex(0), FramePointerSaveIndex(0),
48 NumLocalDynamics(0) {}
49
53 const override;
54
55 // z/OS: Get and set the size of the expected parameter area for the
56 // current function. (ie. Size of param area in caller).
57 unsigned getSizeOfFnParams() const { return SizeOfFnParams; }
58 void setSizeOfFnParams(unsigned Size) { SizeOfFnParams = Size; }
59
60 // Get and set the first and last call-saved GPR that should be saved by
61 // this function and the SP offset for the STMG. These are 0 if no GPRs
62 // need to be saved or restored.
63 SystemZ::GPRRegs getSpillGPRRegs() const { return SpillGPRRegs; }
64 void setSpillGPRRegs(Register Low, Register High, unsigned Offs) {
65 SpillGPRRegs.LowGPR = Low;
66 SpillGPRRegs.HighGPR = High;
67 SpillGPRRegs.GPROffset = Offs;
68 }
69
70 // Get and set the first and last call-saved GPR that should be restored by
71 // this function and the SP offset for the LMG. These are 0 if no GPRs
72 // need to be saved or restored.
73 SystemZ::GPRRegs getRestoreGPRRegs() const { return RestoreGPRRegs; }
74 void setRestoreGPRRegs(Register Low, Register High, unsigned Offs) {
75 RestoreGPRRegs.LowGPR = Low;
76 RestoreGPRRegs.HighGPR = High;
77 RestoreGPRRegs.GPROffset = Offs;
78 }
79
80 // Get and set the number of fixed (as opposed to variable) arguments
81 // that are passed in GPRs to this function.
82 Register getVarArgsFirstGPR() const { return VarArgsFirstGPR; }
83 void setVarArgsFirstGPR(Register GPR) { VarArgsFirstGPR = GPR; }
84
85 // Likewise FPRs.
86 Register getVarArgsFirstFPR() const { return VarArgsFirstFPR; }
87 void setVarArgsFirstFPR(Register FPR) { VarArgsFirstFPR = FPR; }
88
89 // Get and set the frame index of the first stack vararg.
90 unsigned getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
91 void setVarArgsFrameIndex(unsigned FI) { VarArgsFrameIndex = FI; }
92
93 // Get and set the frame index of the register save area
94 // (i.e. the incoming stack pointer).
95 unsigned getRegSaveFrameIndex() const { return RegSaveFrameIndex; }
96 void setRegSaveFrameIndex(unsigned FI) { RegSaveFrameIndex = FI; }
97
98 // Get and set the frame index of where the old frame pointer is stored.
99 int getFramePointerSaveIndex() const { return FramePointerSaveIndex; }
100 void setFramePointerSaveIndex(int Idx) { FramePointerSaveIndex = Idx; }
101
102 // Count number of local-dynamic TLS symbols used.
103 unsigned getNumLocalDynamicTLSAccesses() const { return NumLocalDynamics; }
104 void incNumLocalDynamicTLSAccesses() { ++NumLocalDynamics; }
105
106 // Get and set the function's incoming special XPLINK ABI defined ADA
107 // register.
108 Register getADAVirtualRegister() const { return VRegADA; }
110};
111
112} // end namespace llvm
113
114#endif
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
uint64_t Size
#define F(x, y, z)
Definition: MD5.cpp:55
unsigned Reg
uint64_t High
static const MCPhysReg FPR[]
FPR - The set of FP registers that should be allocated for arguments on Darwin and AIX.
Basic Register Allocator
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:66
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
MachineFunctionInfo * clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF, const DenseMap< MachineBasicBlock *, MachineBasicBlock * > &Src2DstMBB) const override
Make a functionally equivalent copy of this MachineFunctionInfo in MF.
SystemZMachineFunctionInfo(const Function &F, const TargetSubtargetInfo *STI)
void setRestoreGPRRegs(Register Low, Register High, unsigned Offs)
void setSpillGPRRegs(Register Low, Register High, unsigned Offs)
TargetSubtargetInfo - Generic base class for all target subtargets.
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
@ Low
Lower the current thread's priority such that it does not affect foreground tasks significantly.
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...