16#ifndef LLVM_IR_STATEPOINT_H
17#define LLVM_IR_STATEPOINT_H
68 if (
const Function *CF =
I->getCalledFunction())
69 return CF->getIntrinsicID() == Intrinsic::experimental_gc_statepoint;
74 return isa<CallBase>(V) &&
classof(cast<CallBase>(V));
95 cast<ConstantInt>(NumPatchBytesVal)->getZExtValue();
96 assert(isInt<32>(NumPatchBytes) &&
"should fit in 32 bits!");
124 return FT->getReturnType();
148 return Opt->Inputs.begin();
153 return Opt->Inputs.end();
164 return Opt->Inputs.begin();
169 return Opt->Inputs.end();
182 return Opt->Inputs.begin();
189 return Opt->Inputs.end();
203 inline std::vector<const GCRelocateInst *>
getGCRelocates()
const;
207 std::vector<const GCRelocateInst *> Result;
213 if (
auto *Relocate = dyn_cast<GCRelocateInst>(U))
214 Result.push_back(Relocate);
216 auto *StatepointInvoke = dyn_cast<InvokeInst>(
this);
217 if (!StatepointInvoke)
221 LandingPadInst *LandingPad = StatepointInvoke->getLandingPadInst();
224 for (
const User *LandingPadUser : LandingPad->
users()) {
225 if (
auto *Relocate = dyn_cast<GCRelocateInst>(LandingPadUser))
226 Result.push_back(Relocate);
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...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
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.
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
Represents a gc.statepoint intrinsic call.
GCStatepointInst()=delete
uint32_t getNumPatchBytes() const
Return the number of patchable bytes associated with this statepoint.
const_op_iterator deopt_begin() const
const_op_iterator deopt_end() const
int getNumCallArgs() const
Number of arguments to be passed to the actual callee.
size_t actual_arg_size() const
Return the number of arguments to the underlying call.
iterator_range< const_op_iterator > actual_args() const
range adapter for actual call arguments
const_op_iterator gc_transition_args_begin() const
iterator_range< const_op_iterator > deopt_operands() const
range adapter for vm state arguments
GCStatepointInst(const GCStatepointInst &)=delete
uint64_t getID() const
Return the ID associated with this statepoint.
uint64_t getFlags() const
const_op_iterator actual_arg_begin() const
Return an iterator to the begining of the arguments to the underlying call.
Function * getActualCalledFunction() const
Returns the function called if this is a wrapping a direct call, and null otherwise.
const_op_iterator actual_arg_end() const
Return an end iterator of the arguments to the underlying call.
const_op_iterator gc_args_begin() const
Returns an iterator to the begining of the argument range describing gc values for the statepoint.
iterator_range< const_op_iterator > gc_transition_args() const
range adapter for GC transition arguments
iterator_range< const_op_iterator > gc_args() const
range adapter for gc arguments
const_op_iterator gc_args_end() const
Return an end iterator for the gc argument range.
Type * getActualReturnType() const
Return the type of the value returned by the call underlying the statepoint.
static bool classof(const CallBase *I)
GCStatepointInst & operator=(const GCStatepointInst &)=delete
static bool classof(const Value *V)
Value * getActualCalledOperand() const
Return the value actually being called or invoked.
const_op_iterator gc_transition_args_end() const
std::vector< const GCRelocateInst * > getGCRelocates() const
Get list of all gc reloactes linked to this statepoint May contain several relocations for the same b...
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.
A Use represents the edge between a Value definition and its users.
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.
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
StatepointDirectives parseStatepointDirectivesFromAttrs(AttributeList AS)
Parse out statepoint directives from the function attributes present in AS.
StatepointFlags
The statepoint intrinsic accepts a set of flags as its third argument.
@ MaskAll
A bitmask that includes all valid flags.
@ DeoptLiveIn
Mark the deopt arguments associated with the statepoint as only being "live-in".
@ GCTransition
Indicates that this statepoint is a transition from GC-aware code to code that is not GC-aware.
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...
std::optional< uint32_t > NumPatchBytes
std::optional< uint64_t > StatepointID
static const uint64_t DefaultStatepointID
static const uint64_t DeoptBundleStatepointID