Go to the documentation of this file.
16 #ifndef LLVM_IR_STATEPOINT_H
17 #define LLVM_IR_STATEPOINT_H
69 if (
const Function *CF =
I->getCalledFunction())
70 return CF->getIntrinsicID() == Intrinsic::experimental_gc_statepoint;
75 return isa<CallBase>(V) &&
classof(cast<CallBase>(V));
96 cast<ConstantInt>(NumPatchBytesVal)->getZExtValue();
125 return FT->getReturnType();
149 return Opt->Inputs.begin();
154 return Opt->Inputs.end();
165 return Opt->Inputs.begin();
170 return Opt->Inputs.end();
183 return Opt->Inputs.begin();
190 return Opt->Inputs.end();
204 inline std::vector<const GCRelocateInst *>
getGCRelocates()
const;
208 std::vector<const GCRelocateInst *> Result;
214 if (
auto *Relocate = dyn_cast<GCRelocateInst>(U))
215 Result.push_back(Relocate);
217 auto *StatepointInvoke = dyn_cast<InvokeInst>(
this);
218 if (!StatepointInvoke)
222 LandingPadInst *LandingPad = StatepointInvoke->getLandingPadInst();
225 for (
const User *LandingPadUser : LandingPad->
users()) {
226 if (
auto *Relocate = dyn_cast<GCRelocateInst>(LandingPadUser))
227 Result.push_back(Relocate);
254 #endif // LLVM_IR_STATEPOINT_H
uint64_t getID() const
Return the ID associated with this statepoint.
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.
Optional< OperandBundleUse > getOperandBundle(StringRef Name) const
Return an operand bundle by name, if present.
uint64_t getFlags() const
The landingpad instruction holds all of the information necessary to generate correct exception handl...
iterator_range< const_op_iterator > gc_transition_args() const
range adapter for GC transition arguments
uint32_t getNumPatchBytes() const
Return the number of patchable bytes associated with this statepoint.
const_op_iterator gc_transition_args_end() const
const_op_iterator deopt_end() const
The instances of the Type class are immutable: once they are created, they are never changed.
iterator_range< const_op_iterator > deopt_operands() const
range adapter for vm state arguments
const_op_iterator gc_args_begin() const
Returns an iterator to the begining of the argument range describing gc values for the statepoint.
User::op_iterator arg_begin()
Return the iterator pointing to the beginning of the argument list.
Value * getActualCalledOperand() const
Return the value actually being called or invoked.
GCStatepointInst()=delete
Represents a gc.statepoint intrinsic call.
static const uint64_t DeoptBundleStatepointID
const_op_iterator deopt_begin() const
static bool classof(const Value *V)
const_op_iterator gc_args_end() const
Return an end iterator for the gc argument range.
Function * getActualCalledFunction() const
Returns the function called if this is a wrapping a direct call, and null otherwise.
Type * getParamElementType(unsigned ArgNo) const
Extract the elementtype type for a parameter.
std::vector< const GCRelocateInst * > getGCRelocates() const
Get list of all gc reloactes linked to this statepoint May contain several relocations for the same b...
bool isStatepointDirectiveAttr(Attribute Attr)
Return true if the Attr is an attribute that is a statepoint directive.
constexpr bool isInt< 32 >(int64_t x)
GCStatepointInst & operator=(const GCStatepointInst &)=delete
size_t actual_arg_size() const
Return the number of arguments to the underlying call.
Call sites that get wrapped by a gc.statepoint (currently only in RewriteStatepointsForGC and potenti...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
iterator_range< const_op_iterator > actual_args() const
range adapter for actual call arguments
User::op_iterator arg_end()
Return the iterator pointing to the end of the argument list.
const_op_iterator actual_arg_end() const
Return an end iterator of the arguments to the underlying call.
Optional< uint64_t > StatepointID
Optional< uint32_t > NumPatchBytes
static bool classof(const CallBase *I)
@ GCTransition
Indicates that this statepoint is a transition from GC-aware code to code that is not GC-aware.
unsigned arg_size() const
StatepointFlags
The statepoint intrinsic accepts a set of flags as its third argument.
Type * getActualReturnType() const
Return the type of the value returned by the call underlying the statepoint.
StatepointDirectives parseStatepointDirectivesFromAttrs(AttributeList AS)
Parse out statepoint directives from the function attributes present in AS.
static const uint64_t DefaultStatepointID
Value * getArgOperand(unsigned i) const
A range adaptor for a pair of iterators.
const_op_iterator gc_transition_args_begin() const
iterator_range< const_op_iterator > gc_args() const
range adapter for gc arguments
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
@ DeoptLiveIn
Mark the deopt arguments associated with the statepoint as only being "live-in".
@ MaskAll
A bitmask that includes all valid flags.
LLVM Value Representation.
const_op_iterator actual_arg_begin() const
Return an iterator to the begining of the arguments to the underlying call.
iterator_range< user_iterator > users()
A Use represents the edge between a Value definition and its users.
int getNumCallArgs() const
Number of arguments to be passed to the actual callee.