LLVM: lib/Target/RISCV/RISCVMachineFunctionInfo.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13#ifndef LLVM_LIB_TARGET_RISCV_RISCVMACHINEFUNCTIONINFO_H

14#define LLVM_LIB_TARGET_RISCV_RISCVMACHINEFUNCTIONINFO_H

15

20

21namespace llvm {

22

24

25namespace yaml {

36

43}

44

45

46

48private:

49

50 int VarArgsFrameIndex = 0;

51

52 int VarArgsSaveSize = 0;

53

54

55 int MoveF64FrameIndex = -1;

56

57 int BranchRelaxationScratchFrameIndex = -1;

58

59 unsigned LibCallStackSize = 0;

60

62

63 Align RVVStackAlign;

64

66

67 unsigned CalleeSavedStackSize = 0;

68

69 bool IsVectorCall = false;

70

71

73

74

75 unsigned RVPushStackSize = 0;

76 unsigned RVPushRegs = 0;

77

78

79 unsigned QCIInterruptStackSize = 0;

80

81

83

84 int64_t StackProbeSize = 0;

85

86

87 bool HasDynamicAllocation = false;

88

89public:

91

95 const override;

96

99

102

104 if (MoveF64FrameIndex == -1)

105 MoveF64FrameIndex =

107 return MoveF64FrameIndex;

108 }

109

111 return BranchRelaxationScratchFrameIndex;

112 }

114 BranchRelaxationScratchFrameIndex = Index;

115 }

116

118 return LibCallStackSize + RVPushStackSize + QCIInterruptStackSize;

119 }

120

123

132

135

138

141

144

146

148

152

155

158

167

169

175

178

185

191

197

199 InterruptCSRFrameIndexes.push_back(FI);

200 }

202 return InterruptCSRFrameIndexes[Idx];

203 }

204

205

206

207

208

210

212

215

218

221};

222

223}

224

225#endif

bool hasFnAttribute(Attribute::AttrKind Kind) const

Return true if the function has the attribute.

LLVM_ABI int CreateStackObject(uint64_t Size, Align Alignment, bool isSpillSlot, const AllocaInst *Alloca=nullptr, uint8_t ID=0)

Create a new statically sized stack object, returning a nonnegative identifier to represent it.

bool hasTailCall() const

Returns true if the function contains a tail call.

const TargetSubtargetInfo & getSubtarget() const

getSubtarget - Return the subtarget for which this machine code is being compiled.

MachineFrameInfo & getFrameInfo()

getFrameInfo - Return the frame info object for the current function.

Function & getFunction()

Return the LLVM function that this machine code represents.

RISCVMachineFunctionInfo - This class is derived from MachineFunctionInfo and contains private RISCV-...

Definition RISCVMachineFunctionInfo.h:47

bool hasImplicitFPUpdates(const MachineFunction &MF) const

void setLibCallStackSize(unsigned Size)

Definition RISCVMachineFunctionInfo.h:122

bool isPushable(const MachineFunction &MF) const

Definition RISCVMachineFunctionInfo.h:149

unsigned getQCIInterruptStackSize() const

Definition RISCVMachineFunctionInfo.h:176

void setIsVectorCall()

Definition RISCVMachineFunctionInfo.h:217

void initializeBaseYamlFields(const yaml::RISCVMachineFunctionInfo &YamlMFI)

InterruptStackKind getInterruptStackKind(const MachineFunction &MF) const

bool useSiFiveInterrupt(const MachineFunction &MF) const

Definition RISCVMachineFunctionInfo.h:179

bool isSiFivePreemptibleInterrupt(const MachineFunction &MF) const

Definition RISCVMachineFunctionInfo.h:186

void pushInterruptCSRFrameIndex(int FI)

Definition RISCVMachineFunctionInfo.h:198

bool hasDynamicAllocation() const

Definition RISCVMachineFunctionInfo.h:219

void setRVPushStackSize(unsigned Size)

Definition RISCVMachineFunctionInfo.h:157

bool isSExt32Register(Register Reg) const

MachineFunctionInfo * clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF, const DenseMap< MachineBasicBlock *, MachineBasicBlock * > &Src2DstMBB) const override

Make a functionally equivalent copy of this MachineFunctionInfo in MF.

PushPopKind getPushPopKind(const MachineFunction &MF) const

void setCalleeSavedStackSize(unsigned Size)

Definition RISCVMachineFunctionInfo.h:143

void setRVVPadding(uint64_t Padding)

Definition RISCVMachineFunctionInfo.h:140

unsigned getLibCallStackSize() const

Definition RISCVMachineFunctionInfo.h:121

uint64_t getRVVPadding() const

Definition RISCVMachineFunctionInfo.h:139

RISCVMachineFunctionInfo(const Function &F, const RISCVSubtarget *STI)

void setVarArgsFrameIndex(int Index)

Definition RISCVMachineFunctionInfo.h:98

unsigned getRVPushStackSize() const

Definition RISCVMachineFunctionInfo.h:156

int getVarArgsFrameIndex() const

Definition RISCVMachineFunctionInfo.h:97

unsigned getReservedSpillsSize() const

Definition RISCVMachineFunctionInfo.h:117

void setBranchRelaxationScratchFrameIndex(int Index)

Definition RISCVMachineFunctionInfo.h:113

unsigned getRVPushRegs() const

Definition RISCVMachineFunctionInfo.h:153

bool isVectorCall() const

Definition RISCVMachineFunctionInfo.h:216

bool useSaveRestoreLibCalls(const MachineFunction &MF) const

Definition RISCVMachineFunctionInfo.h:124

void setRVVStackSize(uint64_t Size)

Definition RISCVMachineFunctionInfo.h:134

uint64_t getRVVStackSize() const

Definition RISCVMachineFunctionInfo.h:133

void setVarArgsSaveSize(int Size)

Definition RISCVMachineFunctionInfo.h:101

Align getRVVStackAlign() const

Definition RISCVMachineFunctionInfo.h:136

int getBranchRelaxationScratchFrameIndex() const

Definition RISCVMachineFunctionInfo.h:110

unsigned getVarArgsSaveSize() const

Definition RISCVMachineFunctionInfo.h:100

void setDynamicAllocation()

Definition RISCVMachineFunctionInfo.h:220

InterruptStackKind

Definition RISCVMachineFunctionInfo.h:159

@ SiFiveCLICStackSwap

Definition RISCVMachineFunctionInfo.h:164

@ SiFiveCLICPreemptibleStackSwap

Definition RISCVMachineFunctionInfo.h:165

@ QCINest

Definition RISCVMachineFunctionInfo.h:161

@ QCINoNest

Definition RISCVMachineFunctionInfo.h:162

@ SiFiveCLICPreemptible

Definition RISCVMachineFunctionInfo.h:163

int getMoveF64FrameIndex(MachineFunction &MF)

Definition RISCVMachineFunctionInfo.h:103

void setRVVStackAlign(Align StackAlign)

Definition RISCVMachineFunctionInfo.h:137

bool useQCIInterrupt(const MachineFunction &MF) const

Definition RISCVMachineFunctionInfo.h:170

unsigned getCalleeSavedStackSize() const

Definition RISCVMachineFunctionInfo.h:142

void setQCIInterruptStackSize(unsigned Size)

Definition RISCVMachineFunctionInfo.h:177

PushPopKind

Definition RISCVMachineFunctionInfo.h:145

@ VendorXqccmp

Definition RISCVMachineFunctionInfo.h:145

@ None

Definition RISCVMachineFunctionInfo.h:145

@ StdExtZcmp

Definition RISCVMachineFunctionInfo.h:145

bool isSiFiveStackSwapInterrupt(const MachineFunction &MF) const

Definition RISCVMachineFunctionInfo.h:192

void addSExt32Register(Register Reg)

int getInterruptCSRFrameIndex(size_t Idx) const

Definition RISCVMachineFunctionInfo.h:201

void setRVPushRegs(unsigned Regs)

Definition RISCVMachineFunctionInfo.h:154

Wrapper class representing virtual and physical registers.

This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.

void mapOptional(StringRef Key, T &Val)

This is an optimization pass for GlobalISel generic memory operations.

BumpPtrAllocatorImpl<> BumpPtrAllocator

The standard BumpPtrAllocator which just uses the default template parameters.

This struct is a compact representation of a valid (non-zero power of two) alignment.

MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...

Targets should override this in a way that mirrors the implementation of llvm::MachineFunctionInfo.

static void mapping(IO &YamlIO, RISCVMachineFunctionInfo &MFI)

Definition RISCVMachineFunctionInfo.h:38

This class should be specialized by any type that needs to be converted to/from a YAML mapping.

int VarArgsSaveSize

Definition RISCVMachineFunctionInfo.h:28

int VarArgsFrameIndex

Definition RISCVMachineFunctionInfo.h:27

void mappingImpl(yaml::IO &YamlIO) override

~RISCVMachineFunctionInfo() override=default

RISCVMachineFunctionInfo()=default