34 StrConstant,
Name,
nullptr,
46 Value *IRBuilderBase::getCastedInt8PtrValue(
Value *Ptr) {
85 Ptr = getCastedInt8PtrValue(Ptr);
110 Dst = getCastedInt8PtrValue(Dst);
111 Src = getCastedInt8PtrValue(Src);
141 Dst = getCastedInt8PtrValue(Dst);
142 Src = getCastedInt8PtrValue(Src);
165 assert(isa<PointerType>(Ptr->
getType()) &&
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 };
180 assert(isa<PointerType>(Ptr->
getType()) &&
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 };
196 "an assumption condition must be of type i1");
198 Value *Ops[] = { Cond };
217 Type *DataTy = cast<PointerType>(Ptr->
getType())->getElementType();
218 assert(DataTy->isVectorTy() &&
"Ptr should point to a vector");
222 return CreateMaskedIntrinsic(Intrinsic::masked_load, Ops, DataTy, Name);
235 return CreateMaskedIntrinsic(Intrinsic::masked_store, Ops, Val->
getType());
245 Type *OverloadedTypes[] = { DataTy };
250 static std::vector<Value *>
254 std::vector<Value *> Args;
256 Args.push_back(B.
getInt32(NumPatchBytes));
257 Args.push_back(ActualCallee);
260 Args.insert(Args.end(), CallArgs.
begin(), CallArgs.
end());
263 Args.insert(Args.end(), DeoptArgs.
begin(), DeoptArgs.
end());
264 Args.insert(Args.end(), GCArgs.
begin(), GCArgs.
end());
270 uint64_t
ID, uint32_t NumPatchBytes,
Value *ActualCallee,
276 "actual callee must be a callable value");
280 Type *ArgTypes[] = { FuncPtrType };
286 *
this, ID, NumPatchBytes, ActualCallee, CallArgs, DeoptArgs, GCArgs);
291 uint64_t
ID, uint32_t NumPatchBytes,
Value *ActualCallee,
294 std::vector<Value *> VCallArgs;
295 for (
auto &U : CallArgs)
296 VCallArgs.push_back(U.get());
298 DeoptArgs, GCArgs, Name);
302 uint64_t
ID, uint32_t NumPatchBytes,
Value *ActualInvokee,
309 "actual callee must be a callable value");
314 M, Intrinsic::experimental_gc_statepoint, {FuncPtrType});
317 *
this, ID, NumPatchBytes, ActualInvokee, InvokeArgs, DeoptArgs, GCArgs);
323 uint64_t
ID, uint32_t NumPatchBytes,
Value *ActualInvokee,
326 std::vector<Value *> VCallArgs;
327 for (
auto &U : InvokeArgs)
328 VCallArgs.push_back(U.get());
330 UnwindDest, VCallArgs, DeoptArgs, GCArgs,
339 Type *Types[] = {ResultType};
342 Value *Args[] = {Statepoint};
352 Type *Types[] = {ResultType};
353 Value *FnGCRelocate =
356 Value *Args[] = {Statepoint,
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)
getString - This method constructs a CDS and initializes it with a text string.
BasicBlock::iterator GetInsertPoint() const
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...
CallInst - 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
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.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
static CallInst * Create(Value *Func, ArrayRef< Value * > Args, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
IntegerType * getInt64Ty()
Fetch the type representing a 64-bit integer.
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.
Type * getElementType() const
size_t size() const
size - Get the array size.
PointerType - 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.
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.
iterator insert(iterator where, NodeTy *New)
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.
bool isPointerTy() const
isPointerTy - True if this is an instance of PointerType.
static UndefValue * get(Type *T)
get() - Static factory methods - Return an 'undef' object of the specified type.
static std::vector< Value * > getStatepointArgs(IRBuilderBase &B, uint64_t ID, uint32_t NumPatchBytes, Value *ActualCallee, ArrayRef< Value * > CallArgs, ArrayRef< Value * > DeoptArgs, ArrayRef< Value * > GCArgs)
PointerType * getInt8PtrTy(unsigned AddrSpace=0)
Fetch the type representing a pointer to an 8-bit integer value.
void setMetadata(unsigned KindID, MDNode *Node)
setMetadata - Set the metadata of the specified kind to the specified node.
CallInst * CreateLifetimeEnd(Value *Ptr, ConstantInt *Size=nullptr)
Create a lifetime.end intrinsic.
static InvokeInst * Create(Value *Func, BasicBlock *IfNormal, BasicBlock *IfException, ArrayRef< Value * > Args, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
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 ...
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="")
void setUnnamedAddr(bool Val)
CallInst * CreateMaskedLoad(Value *Ptr, unsigned Align, Value *Mask, Value *PassThru=0, const Twine &Name="")
Create a call to Masked Load intrinsic.
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 cl::opt< AlignMode > Align(cl::desc("Load/store alignment support"), cl::Hidden, cl::init(NoStrictAlign), cl::values(clEnumValN(StrictAlign,"aarch64-strict-align","Disallow all unaligned memory accesses"), clEnumValN(NoStrictAlign,"aarch64-no-strict-align","Allow unaligned memory accesses"), clEnumValEnd))
bool isIntegerTy() const
isIntegerTy - True if this is an instance of IntegerType.
IntegerType * getInt1Ty()
Fetch the type representing a single bit.
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.
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 ...
Module * getParent()
Get the module that this global value is contained inside of...
LLVM Value Representation.
InvokeInst - Invoke instruction.
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.