LLVM 17.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;
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
39public:
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
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
#define F(x, y, z)
Definition: MD5.cpp:55
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...