LLVM: include/llvm/IR/Statepoint.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16#ifndef LLVM_IR_STATEPOINT_H

17#define LLVM_IR_STATEPOINT_H

18

29#include

30#include

31#include

32#include

33#include

34

35namespace llvm {

36

37

38

53

54

55

56class GCRelocateInst;

57

58

59

60

62public:

66

68 if (const Function *CF = I->getCalledFunction())

69 return CF->getIntrinsicID() == Intrinsic::experimental_gc_statepoint;

70 return false;

71 }

72

76

77 enum {

84 };

85

86

90

91

96 assert(isInt<32>(NumPatchBytes) && "should fit in 32 bits!");

97 return NumPatchBytes;

98 }

99

100

104

108

109

113

114

115

119

120

121

124 return FT->getReturnType();

125 }

126

127

128

130

135

141

145

148 return Opt->Inputs.begin();

150 }

153 return Opt->Inputs.end();

155 }

156

157

161

164 return Opt->Inputs.begin();

166 }

169 return Opt->Inputs.end();

171 }

172

173

177

178

179

182 return Opt->Inputs.begin();

184 }

185

186

189 return Opt->Inputs.end();

191 }

192

193

197

198

199

200

201

202

203 inline std::vector<const GCRelocateInst *> getGCRelocates() const;

204};

205

207 std::vector<const GCRelocateInst *> Result;

208

209

210

211

214 Result.push_back(Relocate);

215

217 if (!StatepointInvoke)

218 return Result;

219

220

221 LandingPadInst *LandingPad = StatepointInvoke->getLandingPadInst();

222

223

224 for (const User *LandingPadUser : LandingPad->users()) {

226 Result.push_back(Relocate);

227 }

228 return Result;

229}

230

231

232

233

234

242

243

244

246

247

248

250

251}

252

253#endif

assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")

This file contains the simple types necessary to represent the attributes associated with functions a...

This file contains the declarations for the subclasses of Constant, which represent the different fla...

Functions, function parameters, and return types can have attributes to indicate how they should be t...

std::optional< OperandBundleUse > getOperandBundle(StringRef Name) const

Return an operand bundle by name, if present.

User::op_iterator arg_begin()

Return the iterator pointing to the beginning of the argument list.

CallBase(AttributeList const &A, FunctionType *FT, ArgsTy &&... Args)

Type * getParamElementType(unsigned ArgNo) const

Extract the elementtype type for a parameter.

Value * getArgOperand(unsigned i) const

User::op_iterator arg_end()

Return the iterator pointing to the end of the argument list.

unsigned arg_size() const

GCStatepointInst()=delete

uint32_t getNumPatchBytes() const

Return the number of patchable bytes associated with this statepoint.

Definition Statepoint.h:92

const_op_iterator deopt_begin() const

Definition Statepoint.h:162

const_op_iterator deopt_end() const

Definition Statepoint.h:167

int getNumCallArgs() const

Number of arguments to be passed to the actual callee.

Definition Statepoint.h:101

size_t actual_arg_size() const

Return the number of arguments to the underlying call.

Definition Statepoint.h:129

iterator_range< const_op_iterator > actual_args() const

range adapter for actual call arguments

Definition Statepoint.h:142

const_op_iterator gc_transition_args_begin() const

Definition Statepoint.h:146

iterator_range< const_op_iterator > deopt_operands() const

range adapter for vm state arguments

Definition Statepoint.h:174

GCStatepointInst(const GCStatepointInst &)=delete

uint64_t getID() const

Return the ID associated with this statepoint.

Definition Statepoint.h:87

@ CalledFunctionPos

Definition Statepoint.h:80

@ CallArgsBeginPos

Definition Statepoint.h:83

@ NumPatchBytesPos

Definition Statepoint.h:79

@ NumCallArgsPos

Definition Statepoint.h:81

@ FlagsPos

Definition Statepoint.h:82

@ IDPos

Definition Statepoint.h:78

const_op_iterator gc_live_begin() const

Returns an iterator to the begining of the argument range describing gc live values for the statepoin...

Definition Statepoint.h:180

uint64_t getFlags() const

Definition Statepoint.h:105

const_op_iterator actual_arg_begin() const

Return an iterator to the begining of the arguments to the underlying call.

Definition Statepoint.h:131

Function * getActualCalledFunction() const

Returns the function called if this is a wrapping a direct call, and null otherwise.

Definition Statepoint.h:116

const_op_iterator actual_arg_end() const

Return an end iterator of the arguments to the underlying call.

Definition Statepoint.h:136

iterator_range< const_op_iterator > gc_transition_args() const

range adapter for GC transition arguments

Definition Statepoint.h:158

iterator_range< const_op_iterator > gc_live() const

range adapter for gc live arguments

Definition Statepoint.h:194

const_op_iterator gc_live_end() const

Return an end iterator for the gc live range.

Definition Statepoint.h:187

Type * getActualReturnType() const

Return the type of the value returned by the call underlying the statepoint.

Definition Statepoint.h:122

static bool classof(const CallBase *I)

Definition Statepoint.h:67

GCStatepointInst & operator=(const GCStatepointInst &)=delete

static bool classof(const Value *V)

Definition Statepoint.h:73

Value * getActualCalledOperand() const

Return the value actually being called or invoked.

Definition Statepoint.h:110

const_op_iterator gc_transition_args_end() const

Definition Statepoint.h:151

std::vector< const GCRelocateInst * > getGCRelocates() const

Get list of all gc reloactes linked to this statepoint May contain several relocations for the same b...

Definition Statepoint.h:206

The landingpad instruction holds all of the information necessary to generate correct exception handl...

The instances of the Type class are immutable: once they are created, they are never changed.

const Use * const_op_iterator

LLVM Value Representation.

iterator_range< user_iterator > users()

A range adaptor for a pair of iterators.

This provides a very simple, boring adaptor for a begin and end iterator into a range type.

This is an optimization pass for GlobalISel generic memory operations.

constexpr bool isInt(int64_t x)

Checks if an integer fits into the given bit width.

decltype(auto) dyn_cast(const From &Val)

dyn_cast - Return the argument parameter cast to the specified type.

iterator_range< T > make_range(T x, T y)

Convenience function for iterating over sub-ranges.

auto dyn_cast_or_null(const Y &Val)

StatepointDirectives parseStatepointDirectivesFromAttrs(AttributeList AS)

Parse out statepoint directives from the function attributes present in AS.

bool isa(const From &Val)

isa - Return true if the parameter to the template is an instance of one of the template type argu...

StatepointFlags

The statepoint intrinsic accepts a set of flags as its third argument.

Definition Statepoint.h:39

@ MaskAll

A bitmask that includes all valid flags.

Definition Statepoint.h:51

@ DeoptLiveIn

Mark the deopt arguments associated with the statepoint as only being "live-in".

Definition Statepoint.h:49

@ GCTransition

Indicates that this statepoint is a transition from GC-aware code to code that is not GC-aware.

Definition Statepoint.h:41

decltype(auto) cast(const From &Val)

cast - Return the argument parameter cast to the specified type.

bool isStatepointDirectiveAttr(Attribute Attr)

Return true if the Attr is an attribute that is a statepoint directive.

Call sites that get wrapped by a gc.statepoint (currently only in RewriteStatepointsForGC and potenti...

Definition Statepoint.h:235

std::optional< uint32_t > NumPatchBytes

Definition Statepoint.h:236

std::optional< uint64_t > StatepointID

Definition Statepoint.h:237

static const uint64_t DefaultStatepointID

Definition Statepoint.h:239

static const uint64_t DeoptBundleStatepointID

Definition Statepoint.h:240