34 StrConstant,
Name,
nullptr,
85 Ptr = getCastedInt8PtrValue(Ptr);
110 Dst = getCastedInt8PtrValue(Dst);
111 Src = getCastedInt8PtrValue(Src);
140 Dst = getCastedInt8PtrValue(Dst);
141 Src = getCastedInt8PtrValue(Src);
147 M, Intrinsic::memcpy_element_unordered_atomic, Tys);
172 Dst = getCastedInt8PtrValue(Dst);
173 Src = getCastedInt8PtrValue(Src);
198 Value *Ops[] = {Src};
206 Value *Ops[] = {Acc, Src};
210 M, Intrinsic::experimental_vector_reduce_fadd, Tys);
216 Value *Ops[] = {Acc, Src};
220 M, Intrinsic::experimental_vector_reduce_fmul, Tys);
250 auto ID = IsSigned ? Intrinsic::experimental_vector_reduce_smax
251 : Intrinsic::experimental_vector_reduce_umax;
256 auto ID = IsSigned ? Intrinsic::experimental_vector_reduce_smin
257 : Intrinsic::experimental_vector_reduce_umin;
263 this, Intrinsic::experimental_vector_reduce_fmax, Src);
267 Rdx->setFastMathFlags(FMF);
274 this, Intrinsic::experimental_vector_reduce_fmin, Src);
278 Rdx->setFastMathFlags(FMF);
285 "lifetime.start only applies to pointers.");
286 Ptr = getCastedInt8PtrValue(Ptr);
291 "lifetime.start requires the size to be an i64");
301 "lifetime.end only applies to pointers.");
302 Ptr = getCastedInt8PtrValue(Ptr);
307 "lifetime.end requires the size to be an i64");
318 "invariant.start only applies to pointers.");
319 Ptr = getCastedInt8PtrValue(Ptr);
324 "invariant.start requires the size to be an i64");
337 "an assumption condition must be of type i1");
339 Value *Ops[] = { Cond };
358 assert(DataTy->isVectorTy() &&
"Ptr should point to a vector");
361 Type *OverloadedTypes[] = { DataTy, PtrTy };
363 return CreateMaskedIntrinsic(Intrinsic::masked_load, Ops,
364 OverloadedTypes, Name);
377 assert(DataTy->isVectorTy() &&
"Ptr should point to a vector");
378 Type *OverloadedTypes[] = { DataTy, PtrTy };
380 return CreateMaskedIntrinsic(Intrinsic::masked_store, Ops, OverloadedTypes);
406 auto PtrsTy = cast<VectorType>(Ptrs->
getType());
407 auto PtrTy = cast<PointerType>(PtrsTy->getElementType());
408 unsigned NumElts = PtrsTy->getVectorNumElements();
418 Type *OverloadedTypes[] = {DataTy, PtrsTy};
423 return CreateMaskedIntrinsic(Intrinsic::masked_gather, Ops, OverloadedTypes,
436 auto PtrsTy = cast<VectorType>(Ptrs->
getType());
437 auto DataTy = cast<VectorType>(Data->
getType());
438 unsigned NumElts = PtrsTy->getVectorNumElements();
441 auto PtrTy = cast<PointerType>(PtrsTy->getElementType());
442 assert(NumElts == DataTy->getVectorNumElements() &&
443 PtrTy->getElementType() == DataTy->getElementType() &&
444 "Incompatible pointer and data types");
451 Type *OverloadedTypes[] = {DataTy, PtrsTy};
456 return CreateMaskedIntrinsic(Intrinsic::masked_scatter, Ops, OverloadedTypes);
459 template <
typename T0,
typename T1,
typename T2,
typename T3>
460 static std::vector<Value *>
465 std::vector<Value *>
Args;
467 Args.push_back(B.
getInt32(NumPatchBytes));
468 Args.push_back(ActualCallee);
471 Args.insert(Args.end(), CallArgs.
begin(), CallArgs.
end());
473 Args.insert(Args.end(), TransitionArgs.
begin(), TransitionArgs.
end());
475 Args.insert(Args.end(), DeoptArgs.
begin(), DeoptArgs.
end());
476 Args.insert(Args.end(), GCArgs.
begin(), GCArgs.
end());
481 template <
typename T0,
typename T1,
typename T2,
typename T3>
490 "actual callee must be a callable value");
494 Type *ArgTypes[] = { FuncPtrType };
499 std::vector<llvm::Value *>
Args =
501 CallArgs, TransitionArgs, DeoptArgs, GCArgs);
509 return CreateGCStatepointCallCommon<Value *, Value *, Value *, Value *>(
511 CallArgs,
None , DeoptArgs, GCArgs,
Name);
518 return CreateGCStatepointCallCommon<Use, Use, Use, Value *>(
519 this,
ID, NumPatchBytes, ActualCallee,
Flags, CallArgs, TransitionArgs,
520 DeoptArgs, GCArgs,
Name);
527 return CreateGCStatepointCallCommon<Use, Value *, Value *, Value *>(
529 CallArgs,
None, DeoptArgs, GCArgs,
Name);
532 template <
typename T0,
typename T1,
typename T2,
typename T3>
541 "actual callee must be a callable value");
546 M, Intrinsic::experimental_gc_statepoint, {FuncPtrType});
548 std::vector<llvm::Value *>
Args =
550 InvokeArgs, TransitionArgs, DeoptArgs, GCArgs);
560 return CreateGCStatepointInvokeCommon<Value *, Value *, Value *, Value *>(
561 this,
ID, NumPatchBytes, ActualInvokee, NormalDest, UnwindDest,
563 DeoptArgs, GCArgs,
Name);
571 return CreateGCStatepointInvokeCommon<Use, Use, Use, Value *>(
572 this,
ID, NumPatchBytes, ActualInvokee, NormalDest, UnwindDest,
Flags,
573 InvokeArgs, TransitionArgs, DeoptArgs, GCArgs,
Name);
580 return CreateGCStatepointInvokeCommon<Use, Value *, Value *, Value *>(
581 this,
ID, NumPatchBytes, ActualInvokee, NormalDest, UnwindDest,
591 Type *Types[] = {ResultType};
604 Type *Types[] = {ResultType};
605 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. ...
void setNoNaNs()
Flag setters.
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...
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
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 * CreateFAddReduce(Value *Acc, Value *Src)
Create a vector fadd reduction intrinsic of the source vector.
Type * getVectorElementType() const
CallInst * CreateMaskedGather(Value *Ptrs, unsigned Align, Value *Mask=nullptr, Value *PassThru=nullptr, const Twine &Name="")
Create a call to Masked Gather intrinsic.
CallInst * CreateFPMinReduce(Value *Src, bool NoNaN=false)
Create a vector float min reduction intrinsic of the source vector.
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.
size_t size() const
size - Get the array size.
Class to represent pointers.
CallInst * CreateXorReduce(Value *Src)
Create a vector int XOR reduction intrinsic of the source vector.
Type * getReturnType() const
Returns the type of the ret val.
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.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
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.
CallInst * CreateAddReduce(Value *Src)
Create a vector int add reduction intrinsic of the source vector.
This is the shared class of boolean and integer constants.
CallInst * CreateIntMaxReduce(Value *Src, bool IsSigned=false)
Create a vector integer max reduction intrinsic of the source vector.
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 CallInst * getReductionIntrinsic(IRBuilderBase *Builder, Intrinsic::ID ID, Value *Src)
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 * CreateFMulReduce(Value *Acc, Value *Src)
Create a vector fmul reduction intrinsic of the source vector.
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.
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
IntegerType * getInt1Ty()
Fetch the type representing a single bit.
static std::vector< std::string > Flags
CallInst * CreateAndReduce(Value *Src)
Create a vector int AND reduction intrinsic of the source vector.
CallInst * CreateOrReduce(Value *Src)
Create a vector int OR reduction intrinsic of the source vector.
CallInst * CreateBinaryIntrinsic(Intrinsic::ID ID, Value *LHS, Value *RHS, const Twine &Name="")
Create a call to intrinsic ID with 2 operands which is mangled on the first type. ...
CallInst * CreateIntMinReduce(Value *Src, bool IsSigned=false)
Create a vector integer min reduction intrinsic of the source vector.
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 ...
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
CallInst * CreateMulReduce(Value *Src)
Create a vector int mul reduction intrinsic of the source vector.
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.
Convenience struct for specifying and reasoning about fast-math flags.
StringRef - Represent a constant reference to a string, i.e.
static bool isVolatile(Instruction *Inst)
CallInst * CreateElementUnorderedAtomicMemCpy(Value *Dst, Value *Src, uint64_t Size, uint32_t ElementSize, MDNode *TBAATag=nullptr, MDNode *TBAAStructTag=nullptr, MDNode *ScopeTag=nullptr, MDNode *NoAliasTag=nullptr)
Create and insert an element unordered-atomic memcpy between the specified pointers.
CallInst * CreateFPMaxReduce(Value *Src, bool NoNaN=false)
Create a vector float max reduction intrinsic of the source vector.
BasicBlock::iterator InsertPt
void SetInstDebugLocation(Instruction *I) const
If this builder has a current debug location, set it on the specified instruction.