34 StrConstant,
Name,
nullptr,
85 Ptr = getCastedInt8PtrValue(Ptr);
110 Dst = getCastedInt8PtrValue(Dst);
111 Src = getCastedInt8PtrValue(Src);
141 Dst = getCastedInt8PtrValue(Dst);
142 Src = getCastedInt8PtrValue(Src);
166 "lifetime.start only applies to pointers.");
167 Ptr = getCastedInt8PtrValue(Ptr);
172 "lifetime.start requires the size to be an i64");
173 Value *Ops[] = { Size, Ptr };
181 "lifetime.end only applies to pointers.");
182 Ptr = getCastedInt8PtrValue(Ptr);
187 "lifetime.end requires the size to be an i64");
188 Value *Ops[] = { Size, Ptr };
197 "invariant.start only applies to pointers.");
198 Ptr = getCastedInt8PtrValue(Ptr);
203 "invariant.start requires the size to be an i64");
205 Value *Ops[] = {Size, Ptr};
216 "an assumption condition must be of type i1");
218 Value *Ops[] = { Cond };
237 assert(DataTy->isVectorTy() &&
"Ptr should point to a vector");
240 Type *OverloadedTypes[] = { DataTy, PtrTy };
242 return CreateMaskedIntrinsic(Intrinsic::masked_load, Ops,
243 OverloadedTypes, Name);
256 assert(DataTy->isVectorTy() &&
"Ptr should point to a vector");
257 Type *OverloadedTypes[] = { DataTy, PtrTy };
259 return CreateMaskedIntrinsic(Intrinsic::masked_store, Ops, OverloadedTypes);
285 auto PtrsTy = cast<VectorType>(Ptrs->
getType());
286 auto PtrTy = cast<PointerType>(PtrsTy->getElementType());
287 unsigned NumElts = PtrsTy->getVectorNumElements();
298 return CreateMaskedIntrinsic(Intrinsic::masked_gather, Ops, { DataTy },
Name);
310 auto PtrsTy = cast<VectorType>(Ptrs->
getType());
311 auto DataTy = cast<VectorType>(Data->
getType());
312 unsigned NumElts = PtrsTy->getVectorNumElements();
315 auto PtrTy = cast<PointerType>(PtrsTy->getElementType());
316 assert(NumElts == DataTy->getVectorNumElements() &&
317 PtrTy->getElementType() == DataTy->getElementType() &&
318 "Incompatible pointer and data types");
328 return CreateMaskedIntrinsic(Intrinsic::masked_scatter, Ops, { DataTy });
331 template <
typename T0,
typename T1,
typename T2,
typename T3>
332 static std::vector<Value *>
337 std::vector<Value *>
Args;
339 Args.push_back(B.
getInt32(NumPatchBytes));
340 Args.push_back(ActualCallee);
343 Args.insert(Args.end(), CallArgs.
begin(), CallArgs.
end());
345 Args.insert(Args.end(), TransitionArgs.
begin(), TransitionArgs.
end());
347 Args.insert(Args.end(), DeoptArgs.
begin(), DeoptArgs.
end());
348 Args.insert(Args.end(), GCArgs.
begin(), GCArgs.
end());
353 template <
typename T0,
typename T1,
typename T2,
typename T3>
362 "actual callee must be a callable value");
366 Type *ArgTypes[] = { FuncPtrType };
371 std::vector<llvm::Value *>
Args =
373 CallArgs, TransitionArgs, DeoptArgs, GCArgs);
381 return CreateGCStatepointCallCommon<Value *, Value *, Value *, Value *>(
383 CallArgs,
None , DeoptArgs, GCArgs,
Name);
390 return CreateGCStatepointCallCommon<Use, Use, Use, Value *>(
391 this,
ID, NumPatchBytes, ActualCallee,
Flags, CallArgs, TransitionArgs,
392 DeoptArgs, GCArgs,
Name);
399 return CreateGCStatepointCallCommon<Use, Value *, Value *, Value *>(
401 CallArgs,
None, DeoptArgs, GCArgs,
Name);
404 template <
typename T0,
typename T1,
typename T2,
typename T3>
413 "actual callee must be a callable value");
418 M, Intrinsic::experimental_gc_statepoint, {FuncPtrType});
420 std::vector<llvm::Value *>
Args =
422 InvokeArgs, TransitionArgs, DeoptArgs, GCArgs);
432 return CreateGCStatepointInvokeCommon<Value *, Value *, Value *, Value *>(
433 this,
ID, NumPatchBytes, ActualInvokee, NormalDest, UnwindDest,
435 DeoptArgs, GCArgs,
Name);
443 return CreateGCStatepointInvokeCommon<Use, Use, Use, Value *>(
444 this,
ID, NumPatchBytes, ActualInvokee, NormalDest, UnwindDest,
Flags,
445 InvokeArgs, TransitionArgs, DeoptArgs, GCArgs,
Name);
452 return CreateGCStatepointInvokeCommon<Use, Value *, Value *, Value *>(
453 this,
ID, NumPatchBytes, ActualInvokee, NormalDest, UnwindDest,
463 Type *Types[] = {ResultType};
476 Type *Types[] = {ResultType};
477 Value *FnGCRelocate =
Common base class shared among various IRBuilders.
IntegerType * getType() const
getType - Specialize the getType() method to always return an IntegerType, which reduces the amount o...
static Constant * getString(LLVMContext &Context, StringRef Initializer, bool AddNull=true)
This method constructs a CDS and initializes it with a text string.
static IntegerType * getInt1Ty(LLVMContext &C)
BasicBlock::iterator GetInsertPoint() const
CallInst * CreateInvariantStart(Value *Ptr, ConstantInt *Size=nullptr)
Create a call to invariant.start intrinsic.
A Module instance is used to store all the information related to an LLVM module. ...
CallInst * CreateGCRelocate(Instruction *Statepoint, int BaseOffset, int DerivedOffset, Type *ResultType, const Twine &Name="")
Create a call to the experimental.gc.relocate intrinsics to project the relocated value of one pointe...
This class represents a function call, abstracting a target machine's calling convention.
Like Internal, but omit from symbol table.
InvokeInst * CreateGCStatepointInvoke(uint64_t ID, uint32_t NumPatchBytes, Value *ActualInvokee, BasicBlock *NormalDest, BasicBlock *UnwindDest, ArrayRef< Value * > InvokeArgs, ArrayRef< Value * > DeoptArgs, ArrayRef< Value * > GCArgs, const Twine &Name="")
brief Create an invoke to the experimental.gc.statepoint intrinsic to start a new statepoint sequence...
Type * getReturnType() const
Returns the type of the ret val.
const Function * getParent() const
Return the enclosing method, or null if none.
CallInst * CreateMemSet(Value *Ptr, Value *Val, uint64_t Size, unsigned Align, bool isVolatile=false, MDNode *TBAATag=nullptr, MDNode *ScopeTag=nullptr, MDNode *NoAliasTag=nullptr)
Create and insert a memset to the specified pointer and the specified value.
unsigned getAddressSpace() const
Return the address space of the Pointer type.
Type * getElementType() const
struct fuzzer::@269 Flags
static CallInst * CreateGCStatepointCallCommon(IRBuilderBase *Builder, uint64_t ID, uint32_t NumPatchBytes, Value *ActualCallee, uint32_t Flags, ArrayRef< T0 > CallArgs, ArrayRef< T1 > TransitionArgs, ArrayRef< T2 > DeoptArgs, ArrayRef< T3 > GCArgs, const Twine &Name)
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
IntegerType * getInt64Ty()
Fetch the type representing a 64-bit integer.
CallInst * CreateMaskedGather(Value *Ptrs, unsigned Align, Value *Mask=nullptr, Value *PassThru=nullptr, const Twine &Name="")
Create a call to Masked Gather intrinsic.
CallInst * CreateMemMove(Value *Dst, Value *Src, uint64_t Size, unsigned Align, bool isVolatile=false, MDNode *TBAATag=nullptr, MDNode *ScopeTag=nullptr, MDNode *NoAliasTag=nullptr)
Create and insert a memmove between the specified pointers.
This class represents a no-op cast from one type to another.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Function * getDeclaration(Module *M, ID id, ArrayRef< Type * > Tys=None)
Create or insert an LLVM Function declaration for an intrinsic, and return it.
static GCRegistry::Add< OcamlGC > B("ocaml","ocaml 3.10-compatible GC")
size_t size() const
size - Get the array size.
Class to represent pointers.
LLVM Basic Block Representation.
The instances of the Type class are immutable: once they are created, they are never changed...
ConstantInt * getInt1(bool V)
Get a constant value representing either true or false.
Type * getCurrentFunctionReturnType() const
Get the return type of the current function that we're emitting into.
This is an important base class in LLVM.
static InvokeInst * CreateGCStatepointInvokeCommon(IRBuilderBase *Builder, uint64_t ID, uint32_t NumPatchBytes, Value *ActualInvokee, BasicBlock *NormalDest, BasicBlock *UnwindDest, uint32_t Flags, ArrayRef< T0 > InvokeArgs, ArrayRef< T1 > TransitionArgs, ArrayRef< T2 > DeoptArgs, ArrayRef< T3 > GCArgs, const Twine &Name)
CallInst * CreateGCStatepointCall(uint64_t ID, uint32_t NumPatchBytes, Value *ActualCallee, ArrayRef< Value * > CallArgs, ArrayRef< Value * > DeoptArgs, ArrayRef< Value * > GCArgs, const Twine &Name="")
Create a call to the experimental.gc.statepoint intrinsic to start a new statepoint sequence...
const InstListType & getInstList() const
Return the underlying instruction list container.
A specialization of it's base class for read-write access to a gc.statepoint.
ConstantInt * getInt64(uint64_t C)
Get a constant 64-bit value.
static Constant * getAllOnesValue(Type *Ty)
Get the all ones value.
static UndefValue * get(Type *T)
Static factory methods - Return an 'undef' object of the specified type.
PointerType * getInt8PtrTy(unsigned AddrSpace=0)
Fetch the type representing a pointer to an 8-bit integer value.
void setMetadata(unsigned KindID, MDNode *Node)
Set the metadata of the specified kind to the specified node.
static InvokeInst * Create(Value *Func, BasicBlock *IfNormal, BasicBlock *IfException, ArrayRef< Value * > Args, const Twine &NameStr, Instruction *InsertBefore=nullptr)
CallInst * CreateLifetimeEnd(Value *Ptr, ConstantInt *Size=nullptr)
Create a lifetime.end intrinsic.
This is the shared class of boolean and integer constants.
GlobalVariable * CreateGlobalString(StringRef Str, const Twine &Name="", unsigned AddressSpace=0)
Make a new global variable with initializer type i8*.
CallInst * CreateAssumption(Value *Cond)
Create an assume intrinsic call that allows the optimizer to assume that the provided condition will ...
static CallInst * Create(Value *Func, ArrayRef< Value * > Args, ArrayRef< OperandBundleDef > Bundles=None, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Type * getType() const
All values are typed, get the type of this value.
static InvokeInst * createInvokeHelper(Value *Invokee, BasicBlock *NormalDest, BasicBlock *UnwindDest, ArrayRef< Value * > Ops, IRBuilderBase *Builder, const Twine &Name="")
CallInst * CreateMaskedStore(Value *Val, Value *Ptr, unsigned Align, Value *Mask)
Create a call to Masked Store intrinsic.
ConstantInt * getInt32(uint32_t C)
Get a constant 32-bit value.
BasicBlock * GetInsertBlock() const
static std::vector< Value * > getStatepointArgs(IRBuilderBase &B, uint64_t ID, uint32_t NumPatchBytes, Value *ActualCallee, uint32_t Flags, ArrayRef< T0 > CallArgs, ArrayRef< T1 > TransitionArgs, ArrayRef< T2 > DeoptArgs, ArrayRef< T3 > GCArgs)
CallInst * CreateMaskedLoad(Value *Ptr, unsigned Align, Value *Mask, Value *PassThru=nullptr, const Twine &Name="")
Create a call to Masked Load intrinsic.
bool isIntegerTy() const
True if this is an instance of IntegerType.
IntegerType * getInt1Ty()
Fetch the type representing a single bit.
iterator insert(iterator where, pointer New)
CallInst * CreateMemCpy(Value *Dst, Value *Src, uint64_t Size, unsigned Align, bool isVolatile=false, MDNode *TBAATag=nullptr, MDNode *TBAAStructTag=nullptr, MDNode *ScopeTag=nullptr, MDNode *NoAliasTag=nullptr)
Create and insert a memcpy between the specified pointers.
void setUnnamedAddr(UnnamedAddr Val)
CallInst * CreateGCResult(Instruction *Statepoint, Type *ResultType, const Twine &Name="")
Create a call to the experimental.gc.result intrinsic to extract the result from a call wrapped in a ...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
CallInst * CreateMaskedScatter(Value *Val, Value *Ptrs, unsigned Align, Value *Mask=nullptr)
Create a call to Masked Scatter intrinsic.
Module * getParent()
Get the module that this global value is contained inside of...
LLVM Value Representation.
static VectorType * get(Type *ElementType, unsigned NumElements)
This static method is the primary way to construct an VectorType.
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
static CallInst * createCallHelper(Value *Callee, ArrayRef< Value * > Ops, IRBuilderBase *Builder, const Twine &Name="")
CallInst * CreateLifetimeStart(Value *Ptr, ConstantInt *Size=nullptr)
Create a lifetime.start intrinsic.
StringRef - Represent a constant reference to a string, i.e.
static bool isVolatile(Instruction *Inst)
BasicBlock::iterator InsertPt
void SetInstDebugLocation(Instruction *I) const
If this builder has a current debug location, set it on the specified instruction.