LLVM  13.0.0git
Classes | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
llvm::CallBase Class Reference

Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to calling a function. More...

#include "llvm/IR/InstrTypes.h"

Inheritance diagram for llvm::CallBase:
Inheritance graph
[legend]
Collaboration diagram for llvm::CallBase:
Collaboration graph
[legend]

Classes

struct  BundleOpInfo
 Used to keep track of an operand bundle. More...
 

Public Member Functions

FunctionTypegetFunctionType () const
 
void mutateFunctionType (FunctionType *FTy)
 
 DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Value)
 
User::op_iterator data_operands_begin ()
 data_operands_begin/data_operands_end - Return iterators iterating over the call / invoke argument list and bundle operands. More...
 
User::const_op_iterator data_operands_begin () const
 
User::op_iterator data_operands_end ()
 
User::const_op_iterator data_operands_end () const
 
iterator_range< User::op_iteratordata_ops ()
 
iterator_range< User::const_op_iteratordata_ops () const
 
bool data_operands_empty () const
 
unsigned data_operands_size () const
 
bool isDataOperand (const Use *U) const
 
bool isDataOperand (Value::const_user_iterator UI) const
 
unsigned getDataOperandNo (Value::const_user_iterator UI) const
 Given a value use iterator, return the data operand corresponding to it. More...
 
unsigned getDataOperandNo (const Use *U) const
 Given a use for a data operand, get the data operand number that corresponds to it. More...
 
User::op_iterator arg_begin ()
 Return the iterator pointing to the beginning of the argument list. More...
 
User::const_op_iterator arg_begin () const
 
User::op_iterator arg_end ()
 Return the iterator pointing to the end of the argument list. More...
 
User::const_op_iterator arg_end () const
 
iterator_range< User::op_iteratorargs ()
 Iteration adapter for range-for loops. More...
 
iterator_range< User::const_op_iteratorargs () const
 
bool arg_empty () const
 
unsigned arg_size () const
 
iterator_range< User::op_iteratorarg_operands ()
 
iterator_range< User::const_op_iteratorarg_operands () const
 
unsigned getNumArgOperands () const
 
ValuegetArgOperand (unsigned i) const
 
void setArgOperand (unsigned i, Value *v)
 
const UsegetArgOperandUse (unsigned i) const
 Wrappers for getting the Use of a call argument. More...
 
UsegetArgOperandUse (unsigned i)
 
bool isArgOperand (const Use *U) const
 
bool isArgOperand (Value::const_user_iterator UI) const
 
unsigned getArgOperandNo (const Use *U) const
 Given a use for a arg operand, get the arg operand number that corresponds to it. More...
 
unsigned getArgOperandNo (Value::const_user_iterator UI) const
 Given a value use iterator, return the arg operand number corresponding to it. More...
 
bool hasArgument (const Value *V) const
 Returns true if this CallSite passes the given Value* as an argument to the called function. More...
 
ValuegetCalledOperand () const
 
const UsegetCalledOperandUse () const
 
UsegetCalledOperandUse ()
 
FunctiongetCalledFunction () const
 Returns the function called, or null if this is an indirect function invocation. More...
 
bool isIndirectCall () const
 Return true if the callsite is an indirect call. More...
 
bool isCallee (Value::const_user_iterator UI) const
 Determine whether the passed iterator points to the callee operand's Use. More...
 
bool isCallee (const Use *U) const
 Determine whether this Use is the callee operand's Use. More...
 
FunctiongetCaller ()
 Helper to get the caller (the parent function). More...
 
const FunctiongetCaller () const
 
bool isMustTailCall () const
 Tests if this call site must be tail call optimized. More...
 
bool isTailCall () const
 Tests if this call site is marked as a tail call. More...
 
Intrinsic::ID getIntrinsicID () const
 Returns the intrinsic ID of the intrinsic called or Intrinsic::not_intrinsic if the called function is not an intrinsic, or if this is an indirect call. More...
 
void setCalledOperand (Value *V)
 
void setCalledFunction (Function *Fn)
 Sets the function called, including updating the function type. More...
 
void setCalledFunction (FunctionCallee Fn)
 Sets the function called, including updating the function type. More...
 
void setCalledFunction (FunctionType *FTy, Value *Fn)
 Sets the function called, including updating to the specified function type. More...
 
CallingConv::ID getCallingConv () const
 
void setCallingConv (CallingConv::ID CC)
 
bool isInlineAsm () const
 Check if this call is an inline asm statement. More...
 
Attribute API

These methods access and modify attributes on this call (including looking through to the attributes on the called function when necessary).

AttributeList getAttributes () const
 Return the parameter attributes for this call. More...
 
void setAttributes (AttributeList A)
 Set the parameter attributes for this call. More...
 
bool hasFnAttr (Attribute::AttrKind Kind) const
 Determine whether this call has the given attribute. More...
 
bool hasFnAttr (StringRef Kind) const
 Determine whether this call has the given attribute. More...
 
void addAttribute (unsigned i, Attribute::AttrKind Kind)
 adds the attribute to the list of attributes. More...
 
void addAttribute (unsigned i, Attribute Attr)
 adds the attribute to the list of attributes. More...
 
void addParamAttr (unsigned ArgNo, Attribute::AttrKind Kind)
 Adds the attribute to the indicated argument. More...
 
void addParamAttr (unsigned ArgNo, Attribute Attr)
 Adds the attribute to the indicated argument. More...
 
void removeAttribute (unsigned i, Attribute::AttrKind Kind)
 removes the attribute from the list of attributes. More...
 
void removeAttribute (unsigned i, StringRef Kind)
 removes the attribute from the list of attributes. More...
 
void removeAttributes (unsigned i, const AttrBuilder &Attrs)
 
void removeParamAttr (unsigned ArgNo, Attribute::AttrKind Kind)
 Removes the attribute from the given argument. More...
 
void removeParamAttr (unsigned ArgNo, StringRef Kind)
 Removes the attribute from the given argument. More...
 
void removeParamUndefImplyingAttrs (unsigned ArgNo)
 Removes noundef and other attributes that imply undefined behavior if a undef or poison value is passed from the given argument. More...
 
void addDereferenceableAttr (unsigned i, uint64_t Bytes)
 adds the dereferenceable attribute to the list of attributes. More...
 
void addDereferenceableOrNullAttr (unsigned i, uint64_t Bytes)
 adds the dereferenceable_or_null attribute to the list of attributes. More...
 
bool hasRetAttr (Attribute::AttrKind Kind) const
 Determine whether the return value has the given attribute. More...
 
bool hasRetAttr (StringRef Kind) const
 Determine whether the return value has the given attribute. More...
 
bool paramHasAttr (unsigned ArgNo, Attribute::AttrKind Kind) const
 Determine whether the argument or parameter has the given attribute. More...
 
Attribute getAttribute (unsigned i, Attribute::AttrKind Kind) const
 Get the attribute of a given kind at a position. More...
 
Attribute getAttribute (unsigned i, StringRef Kind) const
 Get the attribute of a given kind at a position. More...
 
Attribute getParamAttr (unsigned ArgNo, Attribute::AttrKind Kind) const
 Get the attribute of a given kind from a given arg. More...
 
Attribute getParamAttr (unsigned ArgNo, StringRef Kind) const
 Get the attribute of a given kind from a given arg. More...
 
bool dataOperandHasImpliedAttr (unsigned i, Attribute::AttrKind Kind) const
 Return true if the data operand at index i has the attribute A. More...
 
bool doesNotCapture (unsigned OpNo) const
 Determine whether this data operand is not captured. More...
 
bool isByValArgument (unsigned ArgNo) const
 Determine whether this argument is passed by value. More...
 
bool isInAllocaArgument (unsigned ArgNo) const
 Determine whether this argument is passed in an alloca. More...
 
bool isPassPointeeByValueArgument (unsigned ArgNo) const
 Determine whether this argument is passed by value, in an alloca, or is preallocated. More...
 
bool isPassingUndefUB (unsigned ArgNo) const
 Determine whether passing undef to this argument is undefined behavior. More...
 
bool hasInAllocaArgument () const
 Determine if there are is an inalloca argument. More...
 
bool doesNotAccessMemory (unsigned OpNo) const
 
bool onlyReadsMemory (unsigned OpNo) const
 
bool doesNotReadMemory (unsigned OpNo) const
 
 LLVM_ATTRIBUTE_DEPRECATED (unsigned getRetAlignment() const, "Use getRetAlign() instead")
 
MaybeAlign getRetAlign () const
 Extract the alignment of the return value. More...
 
 LLVM_ATTRIBUTE_DEPRECATED (unsigned getParamAlignment(unsigned ArgNo) const, "Use getParamAlign() instead")
 Extract the alignment for a call or parameter (0=unknown). More...
 
MaybeAlign getParamAlign (unsigned ArgNo) const
 Extract the alignment for a call or parameter (0=unknown). More...
 
TypegetParamByValType (unsigned ArgNo) const
 Extract the byval type for a call or parameter. More...
 
TypegetParamPreallocatedType (unsigned ArgNo) const
 Extract the preallocated type for a call or parameter. More...
 
uint64_t getDereferenceableBytes (unsigned i) const
 Extract the number of dereferenceable bytes for a call or parameter (0=unknown). More...
 
uint64_t getDereferenceableOrNullBytes (unsigned i) const
 Extract the number of dereferenceable_or_null bytes for a call or parameter (0=unknown). More...
 
bool isReturnNonNull () const
 Return true if the return value is known to be not null. More...
 
bool returnDoesNotAlias () const
 Determine if the return value is marked with NoAlias attribute. More...
 
ValuegetReturnedArgOperand () const
 If one of the arguments has the 'returned' attribute, returns its operand value. More...
 
bool isNoBuiltin () const
 Return true if the call should not be treated as a call to a builtin. More...
 
bool isStrictFP () const
 Determine if the call requires strict floating point semantics. More...
 
bool isNoInline () const
 Return true if the call should not be inlined. More...
 
void setIsNoInline ()
 
bool doesNotAccessMemory () const
 Determine if the call does not access memory. More...
 
void setDoesNotAccessMemory ()
 
bool onlyReadsMemory () const
 Determine if the call does not access or only reads memory. More...
 
void setOnlyReadsMemory ()
 
bool doesNotReadMemory () const
 Determine if the call does not access or only writes memory. More...
 
void setDoesNotReadMemory ()
 
bool onlyAccessesArgMemory () const
 Determine if the call can access memmory only using pointers based on its arguments. More...
 
void setOnlyAccessesArgMemory ()
 
bool onlyAccessesInaccessibleMemory () const
 Determine if the function may only access memory that is inaccessible from the IR. More...
 
void setOnlyAccessesInaccessibleMemory ()
 
bool onlyAccessesInaccessibleMemOrArgMem () const
 Determine if the function may only access memory that is either inaccessible from the IR or pointed to by its arguments. More...
 
void setOnlyAccessesInaccessibleMemOrArgMem ()
 
bool doesNotReturn () const
 Determine if the call cannot return. More...
 
void setDoesNotReturn ()
 
bool doesNoCfCheck () const
 Determine if the call should not perform indirect branch tracking. More...
 
bool doesNotThrow () const
 Determine if the call cannot unwind. More...
 
void setDoesNotThrow ()
 
bool cannotDuplicate () const
 Determine if the invoke cannot be duplicated. More...
 
void setCannotDuplicate ()
 
bool cannotMerge () const
 Determine if the call cannot be tail merged. More...
 
void setCannotMerge ()
 
bool isConvergent () const
 Determine if the invoke is convergent. More...
 
void setConvergent ()
 
void setNotConvergent ()
 
bool hasStructRetAttr () const
 Determine if the call returns a structure through first pointer argument. More...
 
bool hasByValArgument () const
 Determine if any call argument is an aggregate passed by value. More...
 
- Public Member Functions inherited from llvm::Instruction
 Instruction (const Instruction &)=delete
 
Instructionoperator= (const Instruction &)=delete
 
Instructionuser_back ()
 Specialize the methods defined in Value, as we know that an instruction can only be used by other instructions. More...
 
const Instructionuser_back () const
 
const BasicBlockgetParent () const
 
BasicBlockgetParent ()
 
const ModulegetModule () const
 Return the module owning the function this instruction belongs to or nullptr it the function does not have a module. More...
 
ModulegetModule ()
 
const FunctiongetFunction () const
 Return the function this instruction belongs to. More...
 
FunctiongetFunction ()
 
void removeFromParent ()
 This method unlinks 'this' from the containing basic block, but does not delete it. More...
 
SymbolTableList< Instruction >::iterator eraseFromParent ()
 This method unlinks 'this' from the containing basic block and deletes it. More...
 
void insertBefore (Instruction *InsertPos)
 Insert an unlinked instruction into a basic block immediately before the specified instruction. More...
 
void insertAfter (Instruction *InsertPos)
 Insert an unlinked instruction into a basic block immediately after the specified instruction. More...
 
void moveBefore (Instruction *MovePos)
 Unlink this instruction from its current basic block and insert it into the basic block that MovePos lives in, right before MovePos. More...
 
void moveBefore (BasicBlock &BB, SymbolTableList< Instruction >::iterator I)
 Unlink this instruction and insert into BB before I. More...
 
void moveAfter (Instruction *MovePos)
 Unlink this instruction from its current basic block and insert it into the basic block that MovePos lives in, right after MovePos. More...
 
bool comesBefore (const Instruction *Other) const
 Given an instruction Other in the same basic block as this instruction, return true if this instruction comes before Other. More...
 
unsigned getOpcode () const
 Returns a member of one of the enums like Instruction::Add. More...
 
const char * getOpcodeName () const
 
bool isTerminator () const
 
bool isUnaryOp () const
 
bool isBinaryOp () const
 
bool isIntDivRem () const
 
bool isShift () const
 
bool isCast () const
 
bool isFuncletPad () const
 
bool isExceptionalTerminator () const
 
bool isIndirectTerminator () const
 
bool isLogicalShift () const
 Return true if this is a logical shift left or a logical shift right. More...
 
bool isArithmeticShift () const
 Return true if this is an arithmetic shift right. More...
 
bool isBitwiseLogicOp () const
 Return true if this is and/or/xor. More...
 
bool hasMetadata () const
 Return true if this instruction has any metadata attached to it. More...
 
bool hasMetadataOtherThanDebugLoc () const
 Return true if this instruction has metadata attached to it other than a debug location. More...
 
bool hasMetadata (unsigned KindID) const
 Return true if this instruction has the given type of metadata attached. More...
 
bool hasMetadata (StringRef Kind) const
 Return true if this instruction has the given type of metadata attached. More...
 
MDNodegetMetadata (unsigned KindID) const
 Get the metadata of given kind attached to this Instruction. More...
 
MDNodegetMetadata (StringRef Kind) const
 Get the metadata of given kind attached to this Instruction. More...
 
void getAllMetadata (SmallVectorImpl< std::pair< unsigned, MDNode * >> &MDs) const
 Get all metadata attached to this Instruction. More...
 
void getAllMetadataOtherThanDebugLoc (SmallVectorImpl< std::pair< unsigned, MDNode * >> &MDs) const
 This does the same thing as getAllMetadata, except that it filters out the debug location. More...
 
void getAAMetadata (AAMDNodes &N, bool Merge=false) const
 Fills the AAMDNodes structure with AA metadata from this instruction. More...
 
void setMetadata (unsigned KindID, MDNode *Node)
 Set the metadata of the specified kind to the specified node. More...
 
void setMetadata (StringRef Kind, MDNode *Node)
 
void copyMetadata (const Instruction &SrcInst, ArrayRef< unsigned > WL=ArrayRef< unsigned >())
 Copy metadata from SrcInst to this instruction. More...
 
void swapProfMetadata ()
 If the instruction has "branch_weights" MD_prof metadata and the MDNode has three operands (including name string), swap the order of the metadata. More...
 
void addAnnotationMetadata (StringRef Annotation)
 Adds an !annotation metadata node with Annotation to this instruction. More...
 
void setAAMetadata (const AAMDNodes &N)
 Sets the metadata on this instruction from the AAMDNodes structure. More...
 
bool extractProfMetadata (uint64_t &TrueVal, uint64_t &FalseVal) const
 Retrieve the raw weight values of a conditional branch or select. More...
 
bool extractProfTotalWeight (uint64_t &TotalVal) const
 Retrieve total raw weight values of a branch. More...
 
void setDebugLoc (DebugLoc Loc)
 Set the debug location information for this instruction. More...
 
const DebugLocgetDebugLoc () const
 Return the debug location for this node as a DebugLoc. More...
 
void setHasNoUnsignedWrap (bool b=true)
 Set or clear the nuw flag on this instruction, which must be an operator which supports this flag. More...
 
void setHasNoSignedWrap (bool b=true)
 Set or clear the nsw flag on this instruction, which must be an operator which supports this flag. More...
 
void setIsExact (bool b=true)
 Set or clear the exact flag on this instruction, which must be an operator which supports this flag. More...
 
bool hasNoUnsignedWrap () const
 Determine whether the no unsigned wrap flag is set. More...
 
bool hasNoSignedWrap () const
 Determine whether the no signed wrap flag is set. More...
 
void dropPoisonGeneratingFlags ()
 Drops flags that may cause this instruction to evaluate to poison despite having non-poison inputs. More...
 
bool isExact () const
 Determine whether the exact flag is set. More...
 
void setFast (bool B)
 Set or clear all fast-math-flags on this instruction, which must be an operator which supports this flag. More...
 
void setHasAllowReassoc (bool B)
 Set or clear the reassociation flag on this instruction, which must be an operator which supports this flag. More...
 
void setHasNoNaNs (bool B)
 Set or clear the no-nans flag on this instruction, which must be an operator which supports this flag. More...
 
void setHasNoInfs (bool B)
 Set or clear the no-infs flag on this instruction, which must be an operator which supports this flag. More...
 
void setHasNoSignedZeros (bool B)
 Set or clear the no-signed-zeros flag on this instruction, which must be an operator which supports this flag. More...
 
void setHasAllowReciprocal (bool B)
 Set or clear the allow-reciprocal flag on this instruction, which must be an operator which supports this flag. More...
 
void setHasAllowContract (bool B)
 Set or clear the allow-contract flag on this instruction, which must be an operator which supports this flag. More...
 
void setHasApproxFunc (bool B)
 Set or clear the approximate-math-functions flag on this instruction, which must be an operator which supports this flag. More...
 
void setFastMathFlags (FastMathFlags FMF)
 Convenience function for setting multiple fast-math flags on this instruction, which must be an operator which supports these flags. More...
 
void copyFastMathFlags (FastMathFlags FMF)
 Convenience function for transferring all fast-math flag values to this instruction, which must be an operator which supports these flags. More...
 
bool isFast () const
 Determine whether all fast-math-flags are set. More...
 
bool hasAllowReassoc () const
 Determine whether the allow-reassociation flag is set. More...
 
bool hasNoNaNs () const
 Determine whether the no-NaNs flag is set. More...
 
bool hasNoInfs () const
 Determine whether the no-infs flag is set. More...
 
bool hasNoSignedZeros () const
 Determine whether the no-signed-zeros flag is set. More...
 
bool hasAllowReciprocal () const
 Determine whether the allow-reciprocal flag is set. More...
 
bool hasAllowContract () const
 Determine whether the allow-contract flag is set. More...
 
bool hasApproxFunc () const
 Determine whether the approximate-math-functions flag is set. More...
 
FastMathFlags getFastMathFlags () const
 Convenience function for getting all the fast-math flags, which must be an operator which supports these flags. More...
 
void copyFastMathFlags (const Instruction *I)
 Copy I's fast-math flags. More...
 
void copyIRFlags (const Value *V, bool IncludeWrapFlags=true)
 Convenience method to copy supported exact, fast-math, and (optionally) wrapping flags from V to this instruction. More...
 
void andIRFlags (const Value *V)
 Logical 'and' of any supported wrapping, exact, and fast-math flags of V and this instruction. More...
 
void applyMergedLocation (const DILocation *LocA, const DILocation *LocB)
 Merge 2 debug locations and apply it to the Instruction. More...
 
void updateLocationAfterHoist ()
 Updates the debug location given that the instruction has been hoisted from a block to a predecessor of that block. More...
 
void dropLocation ()
 Drop the instruction's debug location. More...
 
bool isAssociative () const LLVM_READONLY
 Return true if the instruction is associative: More...
 
bool isCommutative () const LLVM_READONLY
 Return true if the instruction is commutative: More...
 
bool isIdempotent () const
 Return true if the instruction is idempotent: More...
 
bool isNilpotent () const
 Return true if the instruction is nilpotent: More...
 
bool mayWriteToMemory () const
 Return true if this instruction may modify memory. More...
 
bool mayReadFromMemory () const
 Return true if this instruction may read memory. More...
 
bool mayReadOrWriteMemory () const
 Return true if this instruction may read or write memory. More...
 
bool isAtomic () const
 Return true if this instruction has an AtomicOrdering of unordered or higher. More...
 
bool hasAtomicLoad () const
 Return true if this atomic instruction loads from memory. More...
 
bool hasAtomicStore () const
 Return true if this atomic instruction stores to memory. More...
 
bool isVolatile () const
 Return true if this instruction has a volatile memory access. More...
 
bool mayThrow () const
 Return true if this instruction may throw an exception. More...
 
bool isFenceLike () const
 Return true if this instruction behaves like a memory fence: it can load or store to memory location without being given a memory location. More...
 
bool mayHaveSideEffects () const
 Return true if the instruction may have side effects. More...
 
bool isSafeToRemove () const
 Return true if the instruction can be removed if the result is unused. More...
 
bool willReturn () const
 Return true if the instruction will return (unwinding is considered as a form of returning control flow here). More...
 
bool isEHPad () const
 Return true if the instruction is a variety of EH-block. More...
 
bool isLifetimeStartOrEnd () const
 Return true if the instruction is a llvm.lifetime.start or llvm.lifetime.end marker. More...
 
bool isLaunderOrStripInvariantGroup () const
 Return true if the instruction is a llvm.launder.invariant.group or llvm.strip.invariant.group. More...
 
bool isDebugOrPseudoInst () const
 Return true if the instruction is a DbgInfoIntrinsic or PseudoProbeInst. More...
 
const InstructiongetNextNonDebugInstruction (bool SkipPseudoOp=false) const
 Return a pointer to the next non-debug instruction in the same basic block as 'this', or nullptr if no such instruction exists. More...
 
InstructiongetNextNonDebugInstruction (bool SkipPseudoOp=false)
 
const InstructiongetPrevNonDebugInstruction (bool SkipPseudoOp=false) const
 Return a pointer to the previous non-debug instruction in the same basic block as 'this', or nullptr if no such instruction exists. More...
 
InstructiongetPrevNonDebugInstruction (bool SkipPseudoOp=false)
 
Instructionclone () const
 Create a copy of 'this' instruction that is identical in all ways except the following: More...
 
bool isIdenticalTo (const Instruction *I) const
 Return true if the specified instruction is exactly identical to the current one. More...
 
bool isIdenticalToWhenDefined (const Instruction *I) const
 This is like isIdenticalTo, except that it ignores the SubclassOptionalData flags, which may specify conditions under which the instruction's result is undefined. More...
 
bool isSameOperationAs (const Instruction *I, unsigned flags=0) const
 This function determines if the specified instruction executes the same operation as the current one. More...
 
bool isUsedOutsideOfBlock (const BasicBlock *BB) const
 Return true if there are any uses of this instruction in blocks other than the specified block. More...
 
unsigned getNumSuccessors () const
 Return the number of successors that this instruction has. More...
 
BasicBlockgetSuccessor (unsigned Idx) const
 Return the specified successor. This instruction must be a terminator. More...
 
void setSuccessor (unsigned Idx, BasicBlock *BB)
 Update the specified successor to point at the provided block. More...
 
void replaceSuccessorWith (BasicBlock *OldBB, BasicBlock *NewBB)
 Replace specified successor OldBB to point at the provided block. More...
 
void dropUnknownNonDebugMetadata (ArrayRef< unsigned > KnownIDs)
 Drop all unknown metadata except for debug locations. More...
 
void dropUnknownNonDebugMetadata ()
 
void dropUnknownNonDebugMetadata (unsigned ID1)
 
void dropUnknownNonDebugMetadata (unsigned ID1, unsigned ID2)
 
- Public Member Functions inherited from llvm::User
 User (const User &)=delete
 
void operator delete (void *Usr)
 Free memory allocated for User and Use objects. More...
 
void operator delete (void *Usr, unsigned)
 Placement delete - required by std, called if the ctor throws. More...
 
void operator delete (void *Usr, unsigned, unsigned)
 Placement delete - required by std, called if the ctor throws. More...
 
const UsegetOperandList () const
 
UsegetOperandList ()
 
ValuegetOperand (unsigned i) const
 
void setOperand (unsigned i, Value *Val)
 
const UsegetOperandUse (unsigned i) const
 
UsegetOperandUse (unsigned i)
 
unsigned getNumOperands () const
 
ArrayRef< const uint8_t > getDescriptor () const
 Returns the descriptor co-allocated with this User instance. More...
 
MutableArrayRef< uint8_t > getDescriptor ()
 Returns the descriptor co-allocated with this User instance. More...
 
void setGlobalVariableNumOperands (unsigned NumOps)
 Set the number of operands on a GlobalVariable. More...
 
void setNumHungOffUseOperands (unsigned NumOps)
 Subclasses with hung off uses need to manage the operand count themselves. More...
 
bool isDroppable () const
 A droppable user is a user for which uses can be dropped without affecting correctness and should be dropped rather than preventing a transformation from happening. More...
 
op_iterator op_begin ()
 
const_op_iterator op_begin () const
 
op_iterator op_end ()
 
const_op_iterator op_end () const
 
op_range operands ()
 
const_op_range operands () const
 
value_op_iterator value_op_begin ()
 
value_op_iterator value_op_end ()
 
iterator_range< value_op_iteratoroperand_values ()
 
const_value_op_iterator value_op_begin () const
 
const_value_op_iterator value_op_end () const
 
iterator_range< const_value_op_iteratoroperand_values () const
 
void dropAllReferences ()
 Drop all references to operands. More...
 
void replaceUsesOfWith (Value *From, Value *To)
 Replace uses of one Value with another. More...
 
- Public Member Functions inherited from llvm::Value
 Value (const Value &)=delete
 
Valueoperator= (const Value &)=delete
 
void deleteValue ()
 Delete a pointer to a generic Value. More...
 
void dump () const
 Support for debugging, callable in GDB: V->dump() More...
 
TypegetType () const
 All values are typed, get the type of this value. More...
 
LLVMContextgetContext () const
 All values hold a context through their type. More...
 
bool hasName () const
 
ValueNamegetValueName () const
 
void setValueName (ValueName *VN)
 
StringRef getName () const
 Return a constant reference to the value's name. More...
 
void setName (const Twine &Name)
 Change the name of the value. More...
 
void takeName (Value *V)
 Transfer the name from V to this value. More...
 
std::string getNameOrAsOperand () const
 
void replaceAllUsesWith (Value *V)
 Change all uses of this to point to a new Value. More...
 
void replaceNonMetadataUsesWith (Value *V)
 Change non-metadata uses of this to point to a new Value. More...
 
void replaceUsesWithIf (Value *New, llvm::function_ref< bool(Use &U)> ShouldReplace)
 Go through the uses list for this definition and make each use point to "V" if the callback ShouldReplace returns true for the given Use. More...
 
void replaceUsesOutsideBlock (Value *V, BasicBlock *BB)
 replaceUsesOutsideBlock - Go through the uses list for this definition and make each use point to "V" instead of "this" when the use is outside the block. More...
 
void assertModuleIsMaterializedImpl () const
 
void assertModuleIsMaterialized () const
 
bool use_empty () const
 
bool materialized_use_empty () const
 
use_iterator materialized_use_begin ()
 
const_use_iterator materialized_use_begin () const
 
use_iterator use_begin ()
 
const_use_iterator use_begin () const
 
use_iterator use_end ()
 
const_use_iterator use_end () const
 
iterator_range< use_iteratormaterialized_uses ()
 
iterator_range< const_use_iteratormaterialized_uses () const
 
iterator_range< use_iteratoruses ()
 
iterator_range< const_use_iteratoruses () const
 
bool user_empty () const
 
user_iterator materialized_user_begin ()
 
const_user_iterator materialized_user_begin () const
 
user_iterator user_begin ()
 
const_user_iterator user_begin () const
 
user_iterator user_end ()
 
const_user_iterator user_end () const
 
Useruser_back ()
 
const Useruser_back () const
 
iterator_range< user_iteratormaterialized_users ()
 
iterator_range< const_user_iteratormaterialized_users () const
 
iterator_range< user_iteratorusers ()
 
iterator_range< const_user_iteratorusers () const
 
bool hasOneUse () const
 Return true if there is exactly one use of this value. More...
 
bool hasNUses (unsigned N) const
 Return true if this Value has exactly N uses. More...
 
bool hasNUsesOrMore (unsigned N) const
 Return true if this value has N uses or more. More...
 
bool hasOneUser () const
 Return true if there is exactly one user of this value. More...
 
UsegetSingleUndroppableUse ()
 Return true if there is exactly one use of this value that cannot be dropped. More...
 
const UsegetSingleUndroppableUse () const
 
bool hasNUndroppableUses (unsigned N) const
 Return true if there this value. More...
 
bool hasNUndroppableUsesOrMore (unsigned N) const
 Return true if this value has N uses or more. More...
 
void dropDroppableUses (llvm::function_ref< bool(const Use *)> ShouldDrop=[](const Use *) { return true;})
 Remove every uses that can safely be removed. More...
 
void dropDroppableUsesIn (User &Usr)
 Remove every use of this value in User that can safely be removed. More...
 
bool isUsedInBasicBlock (const BasicBlock *BB) const
 Check if this value is used in the specified basic block. More...
 
unsigned getNumUses () const
 This method computes the number of uses of this Value. More...
 
void addUse (Use &U)
 This method should only be used by the Use class. More...
 
unsigned getValueID () const
 Return an ID for the concrete type of this object. More...
 
unsigned getRawSubclassOptionalData () const
 Return the raw optional flags value contained in this value. More...
 
void clearSubclassOptionalData ()
 Clear the optional flags contained in this value. More...
 
bool hasSameSubclassOptionalData (const Value *V) const
 Check the optional flags for equality. More...
 
bool hasValueHandle () const
 Return true if there is a value handle associated with this value. More...
 
bool isUsedByMetadata () const
 Return true if there is metadata referencing this value. More...
 
bool isSwiftError () const
 Return true if this value is a swifterror value. More...
 
const ValuestripPointerCasts () const
 Strip off pointer casts, all-zero GEPs and address space casts. More...
 
ValuestripPointerCasts ()
 
const ValuestripPointerCastsAndAliases () const
 Strip off pointer casts, all-zero GEPs, address space casts, and aliases. More...
 
ValuestripPointerCastsAndAliases ()
 
const ValuestripPointerCastsSameRepresentation () const
 Strip off pointer casts, all-zero GEPs and address space casts but ensures the representation of the result stays the same. More...
 
ValuestripPointerCastsSameRepresentation ()
 
const ValuestripPointerCastsForAliasAnalysis () const
 Strip off pointer casts, all-zero GEPs, single-argument phi nodes and invariant group info. More...
 
ValuestripPointerCastsForAliasAnalysis ()
 
const ValuestripInBoundsConstantOffsets () const
 Strip off pointer casts and all-constant inbounds GEPs. More...
 
ValuestripInBoundsConstantOffsets ()
 
const ValuestripAndAccumulateConstantOffsets (const DataLayout &DL, APInt &Offset, bool AllowNonInbounds, function_ref< bool(Value &Value, APInt &Offset)> ExternalAnalysis=nullptr) const
 Accumulate the constant offset this value has compared to a base pointer. More...
 
ValuestripAndAccumulateConstantOffsets (const DataLayout &DL, APInt &Offset, bool AllowNonInbounds)
 
const ValuestripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) const
 This is a wrapper around stripAndAccumulateConstantOffsets with the in-bounds requirement set to false. More...
 
ValuestripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset)
 
const ValuestripInBoundsOffsets (function_ref< void(const Value *)> Func=[](const Value *) {}) const
 Strip off pointer casts and inbounds GEPs. More...
 
ValuestripInBoundsOffsets (function_ref< void(const Value *)> Func=[](const Value *) {})
 
bool canBeFreed () const
 Return true if the memory object referred to by V can by freed in the scope for which the SSA value defining the allocation is statically defined. More...
 
uint64_t getPointerDereferenceableBytes (const DataLayout &DL, bool &CanBeNull, bool &CanBeFreed) const
 Returns the number of bytes known to be dereferenceable for the pointer value. More...
 
Align getPointerAlignment (const DataLayout &DL) const
 Returns an alignment of the pointer value. More...
 
const ValueDoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) const
 Translate PHI node to its predecessor from the given basic block. More...
 
ValueDoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB)
 
void mutateType (Type *Ty)
 Mutate the type of this Value to be of the specified type. More...
 
template<class Compare >
void sortUseList (Compare Cmp)
 Sort the use-list. More...
 
void reverseUseList ()
 Reverse the use-list. More...
 
void print (raw_ostream &O, bool IsForDebug=false) const
 Implement operator<< on Value. More...
 
void print (raw_ostream &O, ModuleSlotTracker &MST, bool IsForDebug=false) const
 
void printAsOperand (raw_ostream &O, bool PrintType=true, const Module *M=nullptr) const
 Print the name of this Value out to the specified raw_ostream. More...
 
void printAsOperand (raw_ostream &O, bool PrintType, ModuleSlotTracker &MST) const
 
- Public Member Functions inherited from llvm::ilist_node_with_parent< Instruction, BasicBlock >
InstructiongetPrevNode ()
 
const InstructiongetPrevNode () const
 Get the previous node, or nullptr for the list head. More...
 
InstructiongetNextNode ()
 Get the next node, or nullptr for the list tail. More...
 
const InstructiongetNextNode () const
 Get the next node, or nullptr for the list tail. More...
 
- Public Member Functions inherited from llvm::ilist_node_impl< ilist_detail::compute_node_options< Instruction, Options... >::type >
self_iterator getIterator ()
 
const_self_iterator getIterator () const
 
reverse_self_iterator getReverseIterator ()
 
const_reverse_self_iterator getReverseIterator () const
 
bool isSentinel () const
 Check whether this is the sentinel node. More...
 

Static Public Member Functions

static CallBaseCreate (CallBase *CB, ArrayRef< OperandBundleDef > Bundles, Instruction *InsertPt=nullptr)
 Create a clone of CB with a different set of operand bundles and insert it before InsertPt. More...
 
static CallBaseCreate (CallBase *CB, OperandBundleDef Bundle, Instruction *InsertPt=nullptr)
 Create a clone of CB with the operand bundle with the tag matching Bundle's tag replaced with Bundle, and insert it before InsertPt. More...
 
static CallBaseaddOperandBundle (CallBase *CB, uint32_t ID, OperandBundleDef OB, Instruction *InsertPt=nullptr)
 Create a clone of CB with operand bundle OB added. More...
 
static CallBaseremoveOperandBundle (CallBase *CB, uint32_t ID, Instruction *InsertPt=nullptr)
 Create a clone of CB with operand bundle ID removed. More...
 
static bool classof (const Instruction *I)
 
static bool classof (const Value *V)
 
- Static Public Member Functions inherited from llvm::Instruction
static const char * getOpcodeName (unsigned OpCode)
 
static bool isTerminator (unsigned OpCode)
 
static bool isUnaryOp (unsigned Opcode)
 
static bool isBinaryOp (unsigned Opcode)
 
static bool isIntDivRem (unsigned Opcode)
 
static bool isShift (unsigned Opcode)
 Determine if the Opcode is one of the shift instructions. More...
 
static bool isBitwiseLogicOp (unsigned Opcode)
 Determine if the Opcode is and/or/xor. More...
 
static bool isCast (unsigned OpCode)
 Determine if the OpCode is one of the CastInst instructions. More...
 
static bool isFuncletPad (unsigned OpCode)
 Determine if the OpCode is one of the FuncletPadInst instructions. More...
 
static bool isExceptionalTerminator (unsigned OpCode)
 Returns true if the OpCode is a terminator related to exception handling. More...
 
static bool isIndirectTerminator (unsigned OpCode)
 Returns true if the OpCode is a terminator with indirect targets. More...
 
static bool isAssociative (unsigned Opcode)
 
static bool isCommutative (unsigned Opcode)
 
static bool isIdempotent (unsigned Opcode)
 
static bool isNilpotent (unsigned Opcode)
 
static bool classof (const Value *V)
 Methods for support type inquiry through isa, cast, and dyn_cast: More...
 
- Static Public Member Functions inherited from llvm::User
static bool classof (const Value *V)
 
- Static Public Member Functions inherited from llvm::Value
static void dropDroppableUse (Use &U)
 Remove the droppable use U. More...
 

Protected Types

using CallInstReservedField = Bitfield::Element< unsigned, 0, 2 >
 
using CallingConvField = Bitfield::Element< CallingConv::ID, CallInstReservedField::NextBit, 10, CallingConv::MaxID >
 
- Protected Types inherited from llvm::Instruction
using OpaqueField = Bitfield::Element< uint16_t, 0, 15 >
 
template<unsigned Offset>
using AlignmentBitfieldElementT = typename Bitfield::Element< unsigned, Offset, 5, Value::MaxAlignmentExponent >
 
template<unsigned Offset>
using BoolBitfieldElementT = typename Bitfield::Element< bool, Offset, 1 >
 
template<unsigned Offset>
using AtomicOrderingBitfieldElementT = typename Bitfield::Element< AtomicOrdering, Offset, 3, AtomicOrdering::LAST >
 
- Protected Types inherited from llvm::Value
enum  : unsigned { NumUserOperandsBits = 27 }
 The number of operands in the subclass. More...
 
- Protected Types inherited from llvm::ilist_node_impl< ilist_detail::compute_node_options< Instruction, Options... >::type >
using self_iterator = ilist_iterator< ilist_detail::compute_node_options< Instruction, Options... >::type, false, false >
 
using const_self_iterator = ilist_iterator< ilist_detail::compute_node_options< Instruction, Options... >::type, false, true >
 
using reverse_self_iterator = ilist_iterator< ilist_detail::compute_node_options< Instruction, Options... >::type, true, false >
 
using const_reverse_self_iterator = ilist_iterator< ilist_detail::compute_node_options< Instruction, Options... >::type, true, true >
 

Protected Member Functions

template<class... ArgsTy>
 CallBase (AttributeList const &A, FunctionType *FT, ArgsTy &&... Args)
 
bool hasDescriptor () const
 
unsigned getNumSubclassExtraOperands () const
 
unsigned getNumSubclassExtraOperandsDynamic () const
 Get the number of extra operands for instructions that don't have a fixed number of extra operands. More...
 
 Instruction (const Instruction &)=delete
 
 Instruction (Type *Ty, unsigned iType, Use *Ops, unsigned NumOps, Instruction *InsertBefore=nullptr)
 
 Instruction (Type *Ty, unsigned iType, Use *Ops, unsigned NumOps, BasicBlock *InsertAtEnd)
 
- Protected Member Functions inherited from llvm::Instruction
 ~Instruction ()
 
template<typename BitfieldElement >
BitfieldElement::Type getSubclassData () const
 
template<typename BitfieldElement >
void setSubclassData (typename BitfieldElement::Type Value)
 
 Instruction (Type *Ty, unsigned iType, Use *Ops, unsigned NumOps, Instruction *InsertBefore=nullptr)
 
 Instruction (Type *Ty, unsigned iType, Use *Ops, unsigned NumOps, BasicBlock *InsertAtEnd)
 
- Protected Member Functions inherited from llvm::User
void * operator new (size_t Size)
 Allocate a User with an operand pointer co-allocated. More...
 
void * operator new (size_t Size, unsigned Us)
 Allocate a User with the operands co-allocated. More...
 
void * operator new (size_t Size, unsigned Us, unsigned DescBytes)
 Allocate a User with the operands co-allocated. More...
 
 User (Type *ty, unsigned vty, Use *, unsigned NumOps)
 
void allocHungoffUses (unsigned N, bool IsPhi=false)
 Allocate the array of Uses, followed by a pointer (with bottom bit set) to the User. More...
 
void growHungoffUses (unsigned N, bool IsPhi=false)
 Grow the number of hung off uses. More...
 
 ~User ()=default
 
template<int Idx>
UseOp ()
 
template<int Idx>
const UseOp () const
 
- Protected Member Functions inherited from llvm::Value
 Value (Type *Ty, unsigned scid)
 
 ~Value ()
 Value's destructor should be virtual by design, but that would require that Value and all of its subclasses have a vtable that effectively duplicates the information in the value ID. More...
 
void getAllMetadata (SmallVectorImpl< std::pair< unsigned, MDNode * >> &MDs) const
 Appends all metadata attached to this value to MDs, sorting by KindID. More...
 
bool hasMetadata () const
 Return true if this value has any metadata attached to it. More...
 
bool eraseMetadata (unsigned KindID)
 Erase all metadata attachments with the given kind. More...
 
void clearMetadata ()
 Erase all metadata attached to this Value. More...
 
unsigned short getSubclassDataFromValue () const
 
void setValueSubclassData (unsigned short D)
 
MDNodegetMetadata (unsigned KindID) const
 Get the current metadata attachments for the given kind, if any. More...
 
MDNodegetMetadata (StringRef Kind) const
 
void getMetadata (unsigned KindID, SmallVectorImpl< MDNode * > &MDs) const
 Appends all attachments with the given ID to MDs in insertion order. More...
 
void getMetadata (StringRef Kind, SmallVectorImpl< MDNode * > &MDs) const
 
bool hasMetadata (unsigned KindID) const
 Return true if this value has the given type of metadata attached. More...
 
bool hasMetadata (StringRef Kind) const
 
void setMetadata (unsigned KindID, MDNode *Node)
 Set a particular kind of metadata attachment. More...
 
void setMetadata (StringRef Kind, MDNode *Node)
 
void addMetadata (unsigned KindID, MDNode &MD)
 Add a metadata attachment. More...
 
void addMetadata (StringRef Kind, MDNode &MD)
 
- Protected Member Functions inherited from llvm::ilist_node_with_parent< Instruction, BasicBlock >
 ilist_node_with_parent ()=default
 
- Protected Member Functions inherited from llvm::ilist_node_impl< ilist_detail::compute_node_options< Instruction, Options... >::type >
 ilist_node_impl ()=default
 

Protected Attributes

AttributeList Attrs
 parameter attributes for callable More...
 
FunctionTypeFTy
 
- Protected Attributes inherited from llvm::Value
unsigned char SubclassOptionalData: 7
 Hold subclass data that can be dropped. More...
 
unsigned NumUserOperands: NumUserOperandsBits
 
unsigned IsUsedByMD: 1
 
unsigned HasName: 1
 
unsigned HasMetadata: 1
 
unsigned HasHungOffUses: 1
 
unsigned HasDescriptor: 1
 

Static Protected Attributes

static constexpr int CalledOperandOpEndIdx = -1
 The last operand is the called operand. More...
 

Operand Bundle API

This group of methods provides the API to access and manipulate operand bundles on this call.

using bundle_op_iterator = BundleOpInfo *
 
using const_bundle_op_iterator = const BundleOpInfo *
 
unsigned getNumOperandBundles () const
 Return the number of operand bundles associated with this User. More...
 
bool hasOperandBundles () const
 Return true if this User has any operand bundles. More...
 
unsigned getBundleOperandsStartIndex () const
 Return the index of the first bundle operand in the Use array. More...
 
unsigned getBundleOperandsEndIndex () const
 Return the index of the last bundle operand in the Use array. More...
 
bool isBundleOperand (unsigned Idx) const
 Return true if the operand at index Idx is a bundle operand. More...
 
bool isBundleOperand (const Use *U) const
 Returns true if the use is a bundle operand. More...
 
bool isBundleOperand (Value::const_user_iterator UI) const
 
unsigned getNumTotalBundleOperands () const
 Return the total number operands (not operand bundles) used by every operand bundle in this OperandBundleUser. More...
 
OperandBundleUse getOperandBundleAt (unsigned Index) const
 Return the operand bundle at a specific index. More...
 
unsigned countOperandBundlesOfType (StringRef Name) const
 Return the number of operand bundles with the tag Name attached to this instruction. More...
 
unsigned countOperandBundlesOfType (uint32_t ID) const
 Return the number of operand bundles with the tag ID attached to this instruction. More...
 
Optional< OperandBundleUsegetOperandBundle (StringRef Name) const
 Return an operand bundle by name, if present. More...
 
Optional< OperandBundleUsegetOperandBundle (uint32_t ID) const
 Return an operand bundle by tag ID, if present. More...
 
void getOperandBundlesAsDefs (SmallVectorImpl< OperandBundleDef > &Defs) const
 Return the list of operand bundles attached to this instruction as a vector of OperandBundleDefs. More...
 
OperandBundleUse getOperandBundleForOperand (unsigned OpIdx) const
 Return the operand bundle for the operand at index OpIdx. More...
 
bool hasReadingOperandBundles () const
 Return true if this operand bundle user has operand bundles that may read from the heap. More...
 
bool hasClobberingOperandBundles () const
 Return true if this operand bundle user has operand bundles that may write to the heap. More...
 
bool bundleOperandHasAttr (unsigned OpIdx, Attribute::AttrKind A) const
 Return true if the bundle operand at index OpIdx has the attribute A. More...
 
bool hasIdenticalOperandBundleSchema (const CallBase &Other) const
 Return true if Other has the same sequence of operand bundle tags with the same number of operands on each one of them as this OperandBundleUser. More...
 
bool hasOperandBundlesOtherThan (ArrayRef< uint32_t > IDs) const
 Return true if this operand bundle user contains operand bundles with tags other than those specified in IDs. More...
 
bool isFnAttrDisallowedByOpBundle (StringRef S) const
 Is the function attribute S disallowed by some operand bundle on this operand bundle user? More...
 
bool isFnAttrDisallowedByOpBundle (Attribute::AttrKind A) const
 Is the function attribute A disallowed by some operand bundle on this operand bundle user? More...
 
OperandBundleUse operandBundleFromBundleOpInfo (const BundleOpInfo &BOI) const
 Simple helper function to map a BundleOpInfo to an OperandBundleUse. More...
 
bundle_op_iterator bundle_op_info_begin ()
 Return the start of the list of BundleOpInfo instances associated with this OperandBundleUser. More...
 
const_bundle_op_iterator bundle_op_info_begin () const
 Return the start of the list of BundleOpInfo instances associated with this OperandBundleUser. More...
 
bundle_op_iterator bundle_op_info_end ()
 Return the end of the list of BundleOpInfo instances associated with this OperandBundleUser. More...
 
const_bundle_op_iterator bundle_op_info_end () const
 Return the end of the list of BundleOpInfo instances associated with this OperandBundleUser. More...
 
iterator_range< bundle_op_iteratorbundle_op_infos ()
 Return the range [bundle_op_info_begin, bundle_op_info_end). More...
 
iterator_range< const_bundle_op_iteratorbundle_op_infos () const
 Return the range [bundle_op_info_begin, bundle_op_info_end). More...
 
op_iterator populateBundleOperandInfos (ArrayRef< OperandBundleDef > Bundles, const unsigned BeginIndex)
 Populate the BundleOpInfo instances and the Use& vector from Bundles. More...
 
BundleOpInfogetBundleOpInfoForOperand (unsigned OpIdx)
 Return the BundleOpInfo for the operand at index OpIdx. More...
 
const BundleOpInfogetBundleOpInfoForOperand (unsigned OpIdx) const
 
static unsigned CountBundleInputs (ArrayRef< OperandBundleDef > Bundles)
 Return the total number of values used in Bundles. More...
 

Additional Inherited Members

- Public Types inherited from llvm::Instruction
enum  OperationEquivalenceFlags { CompareIgnoringAlignment = 1<<0, CompareUsingScalarTypes = 1<<1 }
 When checking for operation equivalence (using isSameOperationAs) it is sometimes useful to ignore certain attributes. More...
 
enum  TermOps
 
enum  UnaryOps
 
enum  BinaryOps
 
enum  MemoryOps
 
enum  CastOps
 
enum  FuncletPadOps
 
enum  OtherOps
 
- Public Types inherited from llvm::User
using op_iterator = Use *
 
using const_op_iterator = const Use *
 
using op_range = iterator_range< op_iterator >
 
using const_op_range = iterator_range< const_op_iterator >
 
- Public Types inherited from llvm::Value
enum  ValueTy
 Concrete subclass of this. More...
 
using use_iterator = use_iterator_impl< Use >
 
using const_use_iterator = use_iterator_impl< const Use >
 
using user_iterator = user_iterator_impl< User >
 
using const_user_iterator = user_iterator_impl< const User >
 
- Static Public Attributes inherited from llvm::Value
static const unsigned MaxAlignmentExponent = 29
 The maximum alignment for instructions. More...
 
static const unsigned MaximumAlignment = 1u << MaxAlignmentExponent
 
- Static Protected Member Functions inherited from llvm::User
template<int Idx, typename U >
static UseOpFrom (const U *that)
 

Detailed Description

Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to calling a function.

All call-like instructions are required to use a common operand layout:

This allows this base class to easily access the called function and the start of the arguments without knowing how many other operands a particular subclass requires. Note that accessing the end of the argument list isn't as cheap as most other operations on the base class.

Definition at line 1164 of file InstrTypes.h.

Member Typedef Documentation

◆ bundle_op_iterator

Definition at line 2136 of file InstrTypes.h.

◆ CallingConvField

Definition at line 1170 of file InstrTypes.h.

◆ CallInstReservedField

using llvm::CallBase::CallInstReservedField = Bitfield::Element<unsigned, 0, 2>
protected

Definition at line 1167 of file InstrTypes.h.

◆ const_bundle_op_iterator

Definition at line 2137 of file InstrTypes.h.

Constructor & Destructor Documentation

◆ CallBase()

template<class... ArgsTy>
llvm::CallBase::CallBase ( AttributeList const A,
FunctionType FT,
ArgsTy &&...  Args 
)
inlineprotected

Definition at line 1182 of file InstrTypes.h.

Member Function Documentation

◆ addAttribute() [1/2]

void llvm::CallBase::addAttribute ( unsigned  i,
Attribute  Attr 
)
inline

adds the attribute to the list of attributes.

Definition at line 1500 of file InstrTypes.h.

References llvm::AttributeList::addAttribute(), getAttributes(), llvm::Value::getContext(), i, and setAttributes().

◆ addAttribute() [2/2]

void llvm::CallBase::addAttribute ( unsigned  i,
Attribute::AttrKind  Kind 
)
inline

◆ addDereferenceableAttr()

void llvm::CallBase::addDereferenceableAttr ( unsigned  i,
uint64_t  Bytes 
)
inline

adds the dereferenceable attribute to the list of attributes.

Definition at line 1568 of file InstrTypes.h.

References llvm::AttributeList::addDereferenceableAttr(), getAttributes(), llvm::Value::getContext(), i, and setAttributes().

◆ addDereferenceableOrNullAttr()

void llvm::CallBase::addDereferenceableOrNullAttr ( unsigned  i,
uint64_t  Bytes 
)
inline

adds the dereferenceable_or_null attribute to the list of attributes.

Definition at line 1576 of file InstrTypes.h.

References llvm::AttributeList::addDereferenceableOrNullAttr(), getAttributes(), llvm::Value::getContext(), i, and setAttributes().

◆ addOperandBundle()

CallBase * CallBase::addOperandBundle ( CallBase CB,
uint32_t  ID,
OperandBundleDef  OB,
Instruction InsertPt = nullptr 
)
static

Create a clone of CB with operand bundle OB added.

Definition at line 440 of file Instructions.cpp.

References Create(), getOperandBundle(), getOperandBundlesAsDefs(), and llvm::X86II::OB.

Referenced by inlineRetainOrClaimRVCalls().

◆ addParamAttr() [1/2]

void llvm::CallBase::addParamAttr ( unsigned  ArgNo,
Attribute  Attr 
)
inline

Adds the attribute to the indicated argument.

Definition at line 1515 of file InstrTypes.h.

References llvm::AttributeList::addParamAttribute(), assert(), getAttributes(), llvm::Value::getContext(), getNumArgOperands(), and setAttributes().

◆ addParamAttr() [2/2]

void llvm::CallBase::addParamAttr ( unsigned  ArgNo,
Attribute::AttrKind  Kind 
)
inline

◆ arg_begin() [1/2]

User::op_iterator llvm::CallBase::arg_begin ( )
inline

◆ arg_begin() [2/2]

User::const_op_iterator llvm::CallBase::arg_begin ( ) const
inline

Definition at line 1307 of file InstrTypes.h.

References arg_begin().

◆ arg_empty()

bool llvm::CallBase::arg_empty ( ) const
inline

Definition at line 1328 of file InstrTypes.h.

References arg_begin(), and arg_end().

Referenced by computeBytesPoppedByCalleeForSRet(), and hasInAllocaArgument().

◆ arg_end() [1/2]

User::op_iterator llvm::CallBase::arg_end ( )
inline

◆ arg_end() [2/2]

User::const_op_iterator llvm::CallBase::arg_end ( ) const
inline

Definition at line 1317 of file InstrTypes.h.

References arg_end().

◆ arg_operands() [1/2]

iterator_range<User::op_iterator> llvm::CallBase::arg_operands ( )
inline

◆ arg_operands() [2/2]

iterator_range<User::const_op_iterator> llvm::CallBase::arg_operands ( ) const
inline

Definition at line 1336 of file InstrTypes.h.

References arg_begin(), arg_end(), and llvm::make_range().

◆ arg_size()

unsigned llvm::CallBase::arg_size ( ) const
inline

◆ args() [1/2]

iterator_range<User::op_iterator> llvm::CallBase::args ( )
inline

◆ args() [2/2]

iterator_range<User::const_op_iterator> llvm::CallBase::args ( ) const
inline

Definition at line 1325 of file InstrTypes.h.

References arg_begin(), arg_end(), and llvm::make_range().

◆ bundle_op_info_begin() [1/2]

bundle_op_iterator llvm::CallBase::bundle_op_info_begin ( )
inline

Return the start of the list of BundleOpInfo instances associated with this OperandBundleUser.

OperandBundleUser uses the descriptor area co-allocated with the host User to store some meta information about which operands are "normal" operands, and which ones belong to some operand bundle.

The layout of an operand bundle user is

     +-----------uint32_t End-------------------------------------+
     |                                                            |
     |  +--------uint32_t Begin--------------------+              |
     |  |                                          |              |
     ^  ^                                          v              v

|---—|---—|-—|-—|-—|-—|-—|------—|-—|------—|-—|--— | BOI0 | BOI1 | .. | DU | U0 | U1 | .. | BOI0_U0 | .. | BOI1_U0 | .. | Un |---—|---—|-—|-—|-—|-—|-—|------—|-—|------—|-—|--— v v ^ ^ | | | | | +-----—uint32_t Begin---------—+ | | | +--------—uint32_t End--------------------------—+

BOI0, BOI1 ... are descriptions of operand bundles in this User's use list. These descriptions are installed and managed by this class, and they're all instances of OperandBundleUser<T>::BundleOpInfo.

DU is an additional descriptor installed by User's 'operator new' to keep track of the 'BOI0 ... BOIN' co-allocation. OperandBundleUser does not access or modify DU in any way, it's an implementation detail private to User.

The regular Use& vector for the User starts at U0. The operand bundle uses are part of the Use& vector, just like normal uses. In the diagram above, the operand bundle uses start at BOI0_U0. Each instance of BundleOpInfo has information about a contiguous set of uses constituting an operand bundle, and the total set of operand bundle uses themselves form a contiguous set of uses (i.e. there are no gaps between uses corresponding to individual operand bundles).

This class does not know the location of the set of operand bundle uses within the use list – that is decided by the User using this class via the BeginIdx argument in populateBundleOperandInfos.

Currently operand bundle users with hung-off operands are not supported.

Definition at line 2185 of file InstrTypes.h.

References llvm::User::getDescriptor(), and hasDescriptor().

Referenced by bundle_op_info_begin(), bundle_op_infos(), getBundleOperandsStartIndex(), getBundleOpInfoForOperand(), getNumOperandBundles(), getOperandBundleAt(), hasIdenticalOperandBundleSchema(), and llvm::InstCombinerImpl::visitCallInst().

◆ bundle_op_info_begin() [2/2]

const_bundle_op_iterator llvm::CallBase::bundle_op_info_begin ( ) const
inline

Return the start of the list of BundleOpInfo instances associated with this OperandBundleUser.

Definition at line 2195 of file InstrTypes.h.

References bundle_op_info_begin().

◆ bundle_op_info_end() [1/2]

bundle_op_iterator llvm::CallBase::bundle_op_info_end ( )
inline

Return the end of the list of BundleOpInfo instances associated with this OperandBundleUser.

Definition at line 2202 of file InstrTypes.h.

References llvm::User::getDescriptor(), and hasDescriptor().

Referenced by bundle_op_info_end(), bundle_op_infos(), getBundleOperandsEndIndex(), getBundleOpInfoForOperand(), getNumOperandBundles(), and hasIdenticalOperandBundleSchema().

◆ bundle_op_info_end() [2/2]

const_bundle_op_iterator llvm::CallBase::bundle_op_info_end ( ) const
inline

Return the end of the list of BundleOpInfo instances associated with this OperandBundleUser.

Definition at line 2212 of file InstrTypes.h.

References bundle_op_info_end().

◆ bundle_op_infos() [1/2]

iterator_range<bundle_op_iterator> llvm::CallBase::bundle_op_infos ( )
inline

◆ bundle_op_infos() [2/2]

iterator_range<const_bundle_op_iterator> llvm::CallBase::bundle_op_infos ( ) const
inline

Return the range [bundle_op_info_begin, bundle_op_info_end).

Definition at line 2223 of file InstrTypes.h.

References bundle_op_info_begin(), bundle_op_info_end(), and llvm::make_range().

◆ bundleOperandHasAttr()

bool llvm::CallBase::bundleOperandHasAttr ( unsigned  OpIdx,
Attribute::AttrKind  A 
) const
inline

Return true if the bundle operand at index OpIdx has the attribute A.

Definition at line 2045 of file InstrTypes.h.

References getBundleOpInfoForOperand(), and operandBundleFromBundleOpInfo().

Referenced by dataOperandHasImpliedAttr().

◆ cannotDuplicate()

bool llvm::CallBase::cannotDuplicate ( ) const
inline

Determine if the invoke cannot be duplicated.

Definition at line 1853 of file InstrTypes.h.

References hasFnAttr().

Referenced by canSplitCallSite().

◆ cannotMerge()

bool llvm::CallBase::cannotMerge ( ) const
inline

Determine if the call cannot be tail merged.

Definition at line 1859 of file InstrTypes.h.

References hasFnAttr().

◆ classof() [1/2]

static bool llvm::CallBase::classof ( const Instruction I)
inlinestatic

Definition at line 1235 of file InstrTypes.h.

References llvm::MCID::Call, and I.

Referenced by classof().

◆ classof() [2/2]

static bool llvm::CallBase::classof ( const Value V)
inlinestatic

Definition at line 1240 of file InstrTypes.h.

References classof().

◆ CountBundleInputs()

static unsigned llvm::CallBase::CountBundleInputs ( ArrayRef< OperandBundleDef Bundles)
inlinestaticprotected

Return the total number of values used in Bundles.

Definition at line 2248 of file InstrTypes.h.

References B.

Referenced by llvm::CallInst::Create(), and llvm::CallBrInst::Create().

◆ countOperandBundlesOfType() [1/2]

unsigned llvm::CallBase::countOperandBundlesOfType ( StringRef  Name) const
inline

Return the number of operand bundles with the tag Name attached to this instruction.

Definition at line 1954 of file InstrTypes.h.

References llvm::numbers::e, getNumOperandBundles(), getOperandBundleAt(), and i.

Referenced by getOperandBundle().

◆ countOperandBundlesOfType() [2/2]

unsigned llvm::CallBase::countOperandBundlesOfType ( uint32_t  ID) const
inline

Return the number of operand bundles with the tag ID attached to this instruction.

Definition at line 1965 of file InstrTypes.h.

References llvm::numbers::e, getNumOperandBundles(), getOperandBundleAt(), and i.

◆ Create() [1/2]

CallBase * CallBase::Create ( CallBase CB,
ArrayRef< OperandBundleDef Bundles,
Instruction InsertPt = nullptr 
)
static

Create a clone of CB with a different set of operand bundles and insert it before InsertPt.

The returned call instruction is identical CB in every way except that the operand bundles for the new instruction are set to the operand bundles in Bundles.

Definition at line 251 of file Instructions.cpp.

References llvm::MCID::Call, llvm::CallInst::Create(), llvm::InvokeInst::Create(), llvm::CallBrInst::Create(), llvm::Instruction::getOpcode(), and llvm_unreachable.

Referenced by addOperandBundle(), Create(), llvm::InlineFunction(), removeOperandBundle(), and RemovePreallocated().

◆ Create() [2/2]

CallBase * CallBase::Create ( CallBase CB,
OperandBundleDef  Bundle,
Instruction InsertPt = nullptr 
)
static

Create a clone of CB with the operand bundle with the tag matching Bundle's tag replaced with Bundle, and insert it before InsertPt.

The returned call instruction is identical CI in every way except that the specified operand bundle has been replaced.

Definition at line 265 of file Instructions.cpp.

References Create(), llvm::numbers::e, llvm::SmallVectorImpl< T >::emplace_back(), getNumOperandBundles(), getOperandBundleAt(), llvm::OperandBundleDefT< InputTy >::getTag(), and i.

◆ data_operands_begin() [1/2]

User::op_iterator llvm::CallBase::data_operands_begin ( )
inline

data_operands_begin/data_operands_end - Return iterators iterating over the call / invoke argument list and bundle operands.

For invokes, this is the set of instruction operands except the invoke target and the two successor blocks; and for calls this is the set of instruction operands except the call target.

Definition at line 1258 of file InstrTypes.h.

References llvm::User::op_begin().

Referenced by data_operands_begin(), data_operands_empty(), data_operands_size(), data_ops(), getDataOperandNo(), and isDataOperand().

◆ data_operands_begin() [2/2]

User::const_op_iterator llvm::CallBase::data_operands_begin ( ) const
inline

Definition at line 1259 of file InstrTypes.h.

References data_operands_begin().

◆ data_operands_empty()

bool llvm::CallBase::data_operands_empty ( ) const
inline

Definition at line 1276 of file InstrTypes.h.

References data_operands_begin(), and data_operands_end().

◆ data_operands_end() [1/2]

User::op_iterator llvm::CallBase::data_operands_end ( )
inline

◆ data_operands_end() [2/2]

User::const_op_iterator llvm::CallBase::data_operands_end ( ) const
inline

Definition at line 1267 of file InstrTypes.h.

References data_operands_end().

◆ data_operands_size()

unsigned llvm::CallBase::data_operands_size ( ) const
inline

Definition at line 1279 of file InstrTypes.h.

References data_operands_begin(), and data_operands_end().

Referenced by determinePointerReadAttrs().

◆ data_ops() [1/2]

iterator_range<User::op_iterator> llvm::CallBase::data_ops ( )
inline

Definition at line 1270 of file InstrTypes.h.

References data_operands_begin(), data_operands_end(), and llvm::make_range().

◆ data_ops() [2/2]

iterator_range<User::const_op_iterator> llvm::CallBase::data_ops ( ) const
inline

Definition at line 1273 of file InstrTypes.h.

References data_operands_begin(), data_operands_end(), and llvm::make_range().

◆ dataOperandHasImpliedAttr()

bool llvm::CallBase::dataOperandHasImpliedAttr ( unsigned  i,
Attribute::AttrKind  Kind 
) const
inline

Return true if the data operand at index i has the attribute A.

Data operands include call arguments and values used in operand bundles, but does not include the callee operand. This routine dispatches to the underlying AttributeList or the OperandBundleUser as appropriate.

The index i is interpreted as

i == Attribute::ReturnIndex -> the return value i in [1, arg_size + 1) -> argument number (i - 1) i in [arg_size + 1, data_operand_size + 1) -> bundle operand at index (i - 1) in the operand list.

Definition at line 1627 of file InstrTypes.h.

References assert(), bundleOperandHasAttr(), getBundleOperandsStartIndex(), getNumArgOperands(), getNumTotalBundleOperands(), hasOperandBundles(), hasRetAttr(), i, paramHasAttr(), and llvm::AttributeList::ReturnIndex.

Referenced by doesNotAccessMemory(), doesNotCapture(), doesNotReadMemory(), and onlyReadsMemory().

◆ DECLARE_TRANSPARENT_OPERAND_ACCESSORS()

llvm::CallBase::DECLARE_TRANSPARENT_OPERAND_ACCESSORS ( Value  )

◆ doesNoCfCheck()

bool llvm::CallBase::doesNoCfCheck ( ) const
inline

Determine if the call should not perform indirect branch tracking.

Definition at line 1844 of file InstrTypes.h.

References hasFnAttr().

◆ doesNotAccessMemory() [1/2]

bool llvm::CallBase::doesNotAccessMemory ( ) const
inline

Determine if the call does not access memory.

Definition at line 1788 of file InstrTypes.h.

References hasFnAttr().

Referenced by doesNotReadMemory(), and onlyReadsMemory().

◆ doesNotAccessMemory() [2/2]

bool llvm::CallBase::doesNotAccessMemory ( unsigned  OpNo) const
inline

Definition at line 1693 of file InstrTypes.h.

References dataOperandHasImpliedAttr().

Referenced by determinePointerReadAttrs(), and markTails().

◆ doesNotCapture()

bool llvm::CallBase::doesNotCapture ( unsigned  OpNo) const
inline

Determine whether this data operand is not captured.

Definition at line 1652 of file InstrTypes.h.

References dataOperandHasImpliedAttr().

Referenced by determinePointerReadAttrs().

◆ doesNotReadMemory() [1/2]

bool llvm::CallBase::doesNotReadMemory ( ) const
inline

Determine if the call does not access or only writes memory.

Definition at line 1803 of file InstrTypes.h.

References doesNotAccessMemory(), and hasFnAttr().

◆ doesNotReadMemory() [2/2]

bool llvm::CallBase::doesNotReadMemory ( unsigned  OpNo) const
inline

Definition at line 1706 of file InstrTypes.h.

References dataOperandHasImpliedAttr().

◆ doesNotReturn()

bool llvm::CallBase::doesNotReturn ( ) const
inline

Determine if the call cannot return.

Definition at line 1838 of file InstrTypes.h.

References hasFnAttr().

◆ doesNotThrow()

bool llvm::CallBase::doesNotThrow ( ) const
inline

Determine if the call cannot unwind.

Definition at line 1847 of file InstrTypes.h.

References hasFnAttr().

Referenced by HandleCallsInBlockInlinedThroughInvoke(), llvm::InlineFunction(), and llvm::InstCombinerImpl::visitCallInst().

◆ getArgOperand()

Value* llvm::CallBase::getArgOperand ( unsigned  i) const
inline

Definition at line 1341 of file InstrTypes.h.

References assert(), getNumArgOperands(), llvm::User::getOperand(), and i.

Referenced by AddAlignmentAssumptions(), addIntrinsicToSummary(), allCallersPassValidPointerForArgument(), annotateDereferenceableBytes(), annotateNonNullNoUndefBasedOnAccess(), computeArraySize(), llvm::findDevirtualizableCallsForTypeCheckedLoad(), llvm::findDevirtualizableCallsForTypeTest(), findMatchingAlloca(), foldCtpop(), foldCttzCtlz(), llvm::InstCombinerImpl::foldICmpEqIntrinsicWithConstant(), llvm::InstCombinerImpl::foldICmpIntrinsicWithConstant(), llvm::GCStatepointInst::getActualCalledOperand(), llvm::SITargetLowering::getAddrModeArguments(), llvm::VAStartInst::getArgList(), llvm::VAEndInst::getArgList(), llvm::PseudoProbeInst::getAttributes(), llvm::GCRelocateInst::getBasePtrIndex(), getBranchWeight(), llvm::AbstractCallSite::getCallArgOperand(), llvm::AbstractCallSite::getCalledOperand(), llvm::GCRelocateInst::getDerivedPtrIndex(), llvm::VACopyInst::getDest(), llvm::ConstrainedFPIntrinsic::getExceptionBehavior(), llvm::PseudoProbeInst::getFactor(), llvm::GCStatepointInst::getFlags(), llvm::PseudoProbeInst::getFuncGuid(), llvm::getGuaranteedWellDefinedOps(), llvm::InstrProfIncrementInst::getHash(), llvm::InstrProfValueProfileInst::getHash(), llvm::GCStatepointInst::getID(), llvm::InstrProfIncrementInst::getIndex(), llvm::InstrProfValueProfileInst::getIndex(), llvm::PseudoProbeInst::getIndex(), llvm::MemIntrinsicBase< AnyMemIntrinsic >::getLength(), llvm::MinMaxIntrinsic::getLHS(), llvm::BinaryOpIntrinsic::getLHS(), llvm::VPIntrinsic::getMaskParam(), llvm::InstrProfIncrementInst::getName(), llvm::InstrProfValueProfileInst::getName(), llvm::GCStatepointInst::getNumCallArgs(), llvm::InstrProfIncrementInst::getNumCounters(), llvm::GCStatepointInst::getNumPatchBytes(), llvm::AArch64TTIImpl::getOrCreateResultFromMemIntrinsic(), getParamByValType(), getParamPreallocatedType(), getPointerOperands(), llvm::ConstrainedFPCmpIntrinsic::getPredicate(), llvm::MemIntrinsicBase< AnyMemIntrinsic >::getRawDest(), llvm::AtomicMemIntrinsic::getRawElementSizeInBytes(), llvm::DbgVariableIntrinsic::getRawExpression(), llvm::DbgLabelInst::getRawLabel(), llvm::DbgVariableIntrinsic::getRawLocation(), llvm::DbgVariableIntrinsic::getRawVariable(), getReturnedArgOperand(), llvm::MinMaxIntrinsic::getRHS(), llvm::BinaryOpIntrinsic::getRHS(), llvm::ConstrainedFPIntrinsic::getRoundingMode(), getShape(), llvm::VACopyInst::getSrc(), llvm::GCProjectionInst::getStatepoint(), llvm::InstrProfIncrementInst::getStep(), llvm::InstrProfValueProfileInst::getTargetValue(), llvm::PPCTTIImpl::getTgtMemIntrinsic(), llvm::GCNTTIImpl::getTgtMemIntrinsic(), llvm::AArch64TTIImpl::getTgtMemIntrinsic(), llvm::SITargetLowering::getTgtMemIntrinsic(), llvm::InstrProfValueProfileInst::getValueKind(), llvm::VPIntrinsic::getVectorLengthParam(), llvm::MemIntrinsic::getVolatileCst(), handleBrSelExpect(), handlePhiDef(), handleSwitchExpect(), llvm::InlineFunction(), llvm::PPCTTIImpl::instCombineIntrinsic(), llvm::ARMTTIImpl::instCombineIntrinsic(), llvm::X86TTIImpl::instCombineIntrinsic(), llvm::GCNTTIImpl::instCombineIntrinsic(), InTreeUserNeedToExtract(), llvm::isLegalToPromote(), isLoadInvariantInLoop(), isReportingError(), llvm::GCProjectionInst::isTiedToInvoke(), lowerExpectIntrinsic(), llvm::IntrinsicLowering::LowerIntrinsicCall(), llvm::lowerObjectSizeCall(), llvm::IntrinsicLowering::LowerToByteSwap(), llvm::makeGuardControlFlowExplicit(), OptimizeAwayTrappingUsesOfValue(), optimizeCallInst(), optimizeDoubleFP(), OptimizeEmptyGlobalCXXDtors(), PerformHeapAllocSRoA(), processAbsIntrinsic(), llvm::promoteCall(), RemovePreallocated(), ReplaceFPIntrinsicWithCall(), replaceLongjmpWithEmscriptenLongjmp(), replacePrepare(), replaceUnaryCall(), llvm::GCNTTIImpl::rewriteIntrinsicWithAddressSpace(), scalarizeMaskedCompressStore(), scalarizeMaskedExpandLoad(), scalarizeMaskedGather(), scalarizeMaskedLoad(), scalarizeMaskedScatter(), scalarizeMaskedStore(), llvm::FastISel::selectIntrinsicCall(), setInfoSVEStN(), simplifyAMDGCNMemoryIntrinsicDemanded(), llvm::X86TTIImpl::simplifyDemandedUseBitsIntrinsic(), llvm::X86TTIImpl::simplifyDemandedVectorEltsIntrinsic(), simplifyICmpWithDominatingAssume(), simplifyInvariantGroupIntrinsic(), simplifyNeonTbl1(), simplifyNeonVld1(), simplifyNvvmIntrinsic(), simplifyX86addcarry(), simplifyX86immShift(), simplifyX86insertps(), simplifyX86movmsk(), simplifyX86pack(), simplifyX86pshufb(), simplifyX86varShift(), simplifyX86vpermilvar(), simplifyX86vpermv(), stripDebugDeclareImpl(), llvm::JumpThreadingPass::threadGuard(), tryToMoveFreeBeforeNullTest(), tryToOptimizeStoreOfMallocToGlobal(), turnGuardIntoBranch(), upgradeAbs(), llvm::UpgradeARCRuntime(), upgradeAVX512MaskToSelect(), upgradeMaskedCompare(), upgradeMaskedMove(), UpgradeMaskToInt(), upgradePMULDQ(), upgradeX86ConcatShift(), UpgradeX86MaskedShift(), upgradeX86Rotate(), upgradeX86vpcom(), UpgradeX86VPERMT2Intrinsics(), llvm::ObjectSizeOffsetVisitor::visitCallBase(), llvm::ObjectSizeOffsetEvaluator::visitCallBase(), llvm::InstCombinerImpl::visitCallInst(), and llvm::InstCombinerImpl::visitFree().

◆ getArgOperandNo() [1/2]

unsigned llvm::CallBase::getArgOperandNo ( const Use U) const
inline

Given a use for a arg operand, get the arg operand number that corresponds to it.

Definition at line 1372 of file InstrTypes.h.

References arg_begin(), assert(), and isArgOperand().

Referenced by llvm::AbstractCallSite::AbstractCallSite(), getArgOperandNo(), llvm::AbstractCallSite::isCallee(), and llvm::runIPSCCP().

◆ getArgOperandNo() [2/2]

unsigned llvm::CallBase::getArgOperandNo ( Value::const_user_iterator  UI) const
inline

Given a value use iterator, return the arg operand number corresponding to it.

Iterator must actually correspond to a data operand.

Definition at line 1379 of file InstrTypes.h.

References getArgOperandNo().

◆ getArgOperandUse() [1/2]

Use& llvm::CallBase::getArgOperandUse ( unsigned  i)
inline

Definition at line 1356 of file InstrTypes.h.

References assert(), getNumArgOperands(), llvm::User::getOperandUse(), and i.

◆ getArgOperandUse() [2/2]

const Use& llvm::CallBase::getArgOperandUse ( unsigned  i) const
inline

◆ getAttribute() [1/2]

Attribute llvm::CallBase::getAttribute ( unsigned  i,
Attribute::AttrKind  Kind 
) const
inline

Get the attribute of a given kind at a position.

Definition at line 1593 of file InstrTypes.h.

References llvm::AttributeList::getAttribute(), getAttributes(), and i.

Referenced by llvm::VFABI::getVectorVariantNames().

◆ getAttribute() [2/2]

Attribute llvm::CallBase::getAttribute ( unsigned  i,
StringRef  Kind 
) const
inline

Get the attribute of a given kind at a position.

Definition at line 1598 of file InstrTypes.h.

References llvm::AttributeList::getAttribute(), getAttributes(), and i.

◆ getAttributes()

AttributeList llvm::CallBase::getAttributes ( ) const
inline

◆ getBundleOperandsEndIndex()

unsigned llvm::CallBase::getBundleOperandsEndIndex ( ) const
inline

Return the index of the last bundle operand in the Use array.

Definition at line 1912 of file InstrTypes.h.

References assert(), bundle_op_info_end(), llvm::CallBase::BundleOpInfo::End, and hasOperandBundles().

Referenced by isBundleOperand().

◆ getBundleOperandsStartIndex()

unsigned llvm::CallBase::getBundleOperandsStartIndex ( ) const
inline

Return the index of the first bundle operand in the Use array.

Definition at line 1906 of file InstrTypes.h.

References assert(), llvm::CallBase::BundleOpInfo::Begin, bundle_op_info_begin(), and hasOperandBundles().

Referenced by dataOperandHasImpliedAttr(), getNumTotalBundleOperands(), and isBundleOperand().

◆ getBundleOpInfoForOperand() [1/2]

CallBase::BundleOpInfo & CallBase::getBundleOpInfoForOperand ( unsigned  OpIdx)

Return the BundleOpInfo for the operand at index OpIdx.

It is an error to call this with an OpIdx that does not correspond to an bundle operand.

When there isn't many bundles, we do a simple linear search. Else fallback to a binary-search that use the fact that bundles usually have similar number of argument to get faster convergence.

We need a decimal number below and to prevent using floating point numbers we use an intergal value multiplied by this constant.

Definition at line 393 of file Instructions.cpp.

References arg_size(), assert(), bundle_op_info_begin(), bundle_op_info_end(), bundle_op_infos(), and llvm_unreachable.

Referenced by bundleOperandHasAttr(), getBundleOpInfoForOperand(), llvm::getKnowledgeFromOperandInAssume(), and getOperandBundleForOperand().

◆ getBundleOpInfoForOperand() [2/2]

const BundleOpInfo& llvm::CallBase::getBundleOpInfoForOperand ( unsigned  OpIdx) const
inline

Definition at line 2242 of file InstrTypes.h.

References getBundleOpInfoForOperand().

◆ getCalledFunction()

Function* llvm::CallBase::getCalledFunction ( ) const
inline

Returns the function called, or null if this is an indirect function invocation.

Definition at line 1396 of file InstrTypes.h.

References getCalledOperand().

Referenced by llvm::AbstractCallSite::AbstractCallSite(), AddAliasScopeMetadata(), AddAlignmentAssumptions(), addIntrinsicToSummary(), addMappingsFromTLI(), addNoRecurseAttrs(), AddReturnAttributes(), addVariantDeclaration(), llvm::ArgumentPromotionPass::areFunctionArgsABICompatible(), llvm::CloneAndPruneIntoFromInst(), llvm::OpenMPIRBuilder::createParallel(), createSCCNodeSet(), determinePointerReadAttrs(), doCallSiteSplitting(), doPromotion(), llvm::findDevirtualizableCallsForTypeCheckedLoad(), llvm::findDevirtualizableCallsForTypeTest(), llvm::AMDGPULibCalls::fold(), llvm::InlineAdvisor::getAdvice(), llvm::ReplayInlineAdvisor::getAdviceImpl(), llvm::objcarc::GetARCInstKind(), llvm::AbstractCallSite::getCallbackUses(), getCalledFunctionName(), getDefaultInlineAdvice(), llvm::getIntrinsicForCallSite(), llvm::IntrinsicInst::getIntrinsicID(), getIntrinsicID(), llvm::TargetLibraryInfo::getLibFunc(), llvm::InlineAdvisor::getMandatoryKind(), getReturnedArgOperand(), llvm::LoopVectorizationCostModel::getVectorCallCost(), llvm::LoopVectorizationCostModel::getVectorIntrinsicCost(), llvm::VFDatabase::getVectorizedFunction(), handleBrSelExpect(), HandleCallsInBlockInlinedThroughInvoke(), handlePhiDef(), handleSwitchExpect(), inlineCallIfPossible(), llvm::InlineFunction(), llvm::AutoInitRemark::inspectCall(), llvm::GCNTTIImpl::instCombineIntrinsic(), InstrBreaksNoFree(), InstrBreaksNonConvergent(), InstrBreaksNoSync(), instructionDoesNotReturn(), llvm::IntrinsicCostAttributes::IntrinsicCostAttributes(), isFunctionMallocLike(), llvm::isLegalToPromote(), isReturnNonNull(), llvm::isTLIScalarize(), llvm::SITargetLowering::LowerCall(), lowerExpectIntrinsic(), llvm::IntrinsicLowering::LowerIntrinsicCall(), llvm::maybeMarkSanitizerLibraryCallNoBuiltin(), llvm::FortifiedLibCallSimplifier::optimizeCall(), llvm::LibCallSimplifier::optimizeCall(), optimizeDoubleFP(), paramHasAttr(), llvm::SITargetLowering::passSpecialInputs(), llvm::promoteCall(), llvm::CallGraphUpdater::replaceCallSite(), replaceLongjmpWithEmscriptenLongjmp(), replaceWithCallToVeclib(), replaceWithTLIFunction(), llvm::AMDGPUSimplifyLibCallsPass::run(), llvm::AMDGPUUseNativeCallsPass::run(), llvm::InlinerPass::run(), llvm::AMDGPULowerKernelAttributesPass::run(), runCGProfilePass(), llvm::runIPSCCP(), shouldBeDeferred(), llvm::shouldInline(), simplifyAMDGCNImageIntrinsic(), simplifyAMDGCNMemoryIntrinsicDemanded(), llvm::InstCombiner::targetInstCombineIntrinsic(), llvm::InstCombiner::targetSimplifyDemandedUseBitsIntrinsic(), llvm::InstCombiner::targetSimplifyDemandedVectorEltsIntrinsic(), llvm::tryPromoteCall(), tryToReplaceWithConstant(), UpdateCallGraphAfterInlining(), llvm::UpgradeARCRuntime(), llvm::UpgradeIntrinsicCall(), llvm::AMDGPULibCalls::useNative(), llvm::InstCombinerImpl::visitCallInst(), and llvm::IRSimilarity::IRInstructionMapper::InstructionClassification::visitCallInst().

◆ getCalledOperand()

Value* llvm::CallBase::getCalledOperand ( ) const
inline

◆ getCalledOperandUse() [1/2]

Use& llvm::CallBase::getCalledOperandUse ( )
inline

Definition at line 1392 of file InstrTypes.h.

◆ getCalledOperandUse() [2/2]

const Use& llvm::CallBase::getCalledOperandUse ( ) const
inline

Definition at line 1391 of file InstrTypes.h.

Referenced by isCallee().

◆ getCaller() [1/2]

Function * CallBase::getCaller ( )

◆ getCaller() [2/2]

const Function* llvm::CallBase::getCaller ( ) const
inline

Definition at line 1413 of file InstrTypes.h.

References getCaller().

◆ getCallingConv()

CallingConv::ID llvm::CallBase::getCallingConv ( ) const
inline

◆ getDataOperandNo() [1/2]

unsigned llvm::CallBase::getDataOperandNo ( const Use U) const
inline

Given a use for a data operand, get the data operand number that corresponds to it.

Definition at line 1300 of file InstrTypes.h.

References assert(), data_operands_begin(), and isDataOperand().

◆ getDataOperandNo() [2/2]

unsigned llvm::CallBase::getDataOperandNo ( Value::const_user_iterator  UI) const
inline

Given a value use iterator, return the data operand corresponding to it.

Iterator must actually correspond to a data operand.

Definition at line 1294 of file InstrTypes.h.

◆ getDereferenceableBytes()

uint64_t llvm::CallBase::getDereferenceableBytes ( unsigned  i) const
inline

Extract the number of dereferenceable bytes for a call or parameter (0=unknown).

Definition at line 1748 of file InstrTypes.h.

References Attrs, llvm::AttributeList::getDereferenceableBytes(), and i.

Referenced by annotateDereferenceableBytes(), and isReturnNonNull().

◆ getDereferenceableOrNullBytes()

uint64_t llvm::CallBase::getDereferenceableOrNullBytes ( unsigned  i) const
inline

Extract the number of dereferenceable_or_null bytes for a call or parameter (0=unknown).

Definition at line 1754 of file InstrTypes.h.

References Attrs, llvm::AttributeList::getDereferenceableOrNullBytes(), and i.

Referenced by annotateDereferenceableBytes().

◆ getFunctionType()

FunctionType* llvm::CallBase::getFunctionType ( ) const
inline

◆ getIntrinsicID()

Intrinsic::ID CallBase::getIntrinsicID ( ) const

Returns the intrinsic ID of the intrinsic called or Intrinsic::not_intrinsic if the called function is not an intrinsic, or if this is an indirect call.

Definition at line 307 of file Instructions.cpp.

References F, getCalledFunction(), and llvm::Intrinsic::not_intrinsic.

Referenced by llvm::objcarc::BundledRetainClaimRVs::eraseInst(), hasReadingOperandBundles(), inlineRetainOrClaimRVCalls(), and processCallSite().

◆ getNumArgOperands()

unsigned llvm::CallBase::getNumArgOperands ( ) const
inline

◆ getNumOperandBundles()

unsigned llvm::CallBase::getNumOperandBundles ( ) const
inline

◆ getNumSubclassExtraOperands()

unsigned llvm::CallBase::getNumSubclassExtraOperands ( ) const
inlineprotected

◆ getNumSubclassExtraOperandsDynamic()

unsigned CallBase::getNumSubclassExtraOperandsDynamic ( ) const
protected

Get the number of extra operands for instructions that don't have a fixed number of extra operands.

Definition at line 280 of file Instructions.cpp.

References assert(), and llvm::Instruction::getOpcode().

Referenced by getNumSubclassExtraOperands().

◆ getNumTotalBundleOperands()

unsigned llvm::CallBase::getNumTotalBundleOperands ( ) const
inline

Return the total number operands (not operand bundles) used by every operand bundle in this OperandBundleUser.

Definition at line 1935 of file InstrTypes.h.

References getBundleOperandsStartIndex(), and hasOperandBundles().

Referenced by arg_end(), dataOperandHasImpliedAttr(), llvm::CallBrInst::getIndirectDestLabel(), and llvm::CallBrInst::getIndirectDestLabelUse().

◆ getOperandBundle() [1/2]

Optional<OperandBundleUse> llvm::CallBase::getOperandBundle ( StringRef  Name) const
inline

◆ getOperandBundle() [2/2]

Optional<OperandBundleUse> llvm::CallBase::getOperandBundle ( uint32_t  ID) const
inline

Return an operand bundle by tag ID, if present.

It is an error to call this for operand bundle types that may have multiple instances of them on the same instruction.

Definition at line 1994 of file InstrTypes.h.

References assert(), countOperandBundlesOfType(), llvm::numbers::e, getNumOperandBundles(), getOperandBundleAt(), llvm::OperandBundleUse::getTagID(), i, and llvm::None.

◆ getOperandBundleAt()

OperandBundleUse llvm::CallBase::getOperandBundleAt ( unsigned  Index) const
inline

◆ getOperandBundleForOperand()

OperandBundleUse llvm::CallBase::getOperandBundleForOperand ( unsigned  OpIdx) const
inline

Return the operand bundle for the operand at index OpIdx.

It is an error to call this with an OpIdx that does not correspond to an bundle operand.

Definition at line 2019 of file InstrTypes.h.

References getBundleOpInfoForOperand(), and operandBundleFromBundleOpInfo().

◆ getOperandBundlesAsDefs()

void CallBase::getOperandBundlesAsDefs ( SmallVectorImpl< OperandBundleDef > &  Defs) const

Return the list of operand bundles attached to this instruction as a vector of OperandBundleDefs.

This function copies the OperandBundeUse instances associated with this OperandBundleUser to a vector of OperandBundleDefs. Note: OperandBundeUses and OperandBundleDefs are non-trivially different representations of operand bundles (see documentation above).

Definition at line 361 of file Instructions.cpp.

References llvm::numbers::e, llvm::SmallVectorImpl< T >::emplace_back(), getNumOperandBundles(), getOperandBundleAt(), and i.

Referenced by addOperandBundle(), llvm::changeToInvokeAndSplitBasicBlock(), llvm::createCallMatchingInvoke(), doPromotion(), llvm::InlineFunction(), llvm::FortifiedLibCallSimplifier::optimizeCall(), llvm::LibCallSimplifier::optimizeCall(), PerformHeapAllocSRoA(), RemovePreallocated(), replaceWithTLIFunction(), tryToOptimizeStoreOfMallocToGlobal(), and llvm::InstCombinerImpl::visitCallInst().

◆ getParamAlign()

MaybeAlign llvm::CallBase::getParamAlign ( unsigned  ArgNo) const
inline

Extract the alignment for a call or parameter (0=unknown).

Definition at line 1730 of file InstrTypes.h.

References Attrs, and llvm::AttributeList::getParamAlignment().

Referenced by llvm::MemIntrinsicBase< AnyMemIntrinsic >::getDestAlign(), and llvm::MemIntrinsicBase< AnyMemIntrinsic >::getDestAlignment().

◆ getParamAttr() [1/2]

Attribute llvm::CallBase::getParamAttr ( unsigned  ArgNo,
Attribute::AttrKind  Kind 
) const
inline

Get the attribute of a given kind from a given arg.

Definition at line 1603 of file InstrTypes.h.

References assert(), getAttributes(), getNumArgOperands(), and llvm::AttributeList::getParamAttr().

◆ getParamAttr() [2/2]

Attribute llvm::CallBase::getParamAttr ( unsigned  ArgNo,
StringRef  Kind 
) const
inline

Get the attribute of a given kind from a given arg.

Definition at line 1609 of file InstrTypes.h.

References assert(), getAttributes(), getNumArgOperands(), and llvm::AttributeList::getParamAttr().

◆ getParamByValType()

Type* llvm::CallBase::getParamByValType ( unsigned  ArgNo) const
inline

Extract the byval type for a call or parameter.

Definition at line 1735 of file InstrTypes.h.

References Attrs, getArgOperand(), llvm::AttributeList::getParamByValType(), llvm::Type::getPointerElementType(), and llvm::Value::getType().

◆ getParamPreallocatedType()

Type* llvm::CallBase::getParamPreallocatedType ( unsigned  ArgNo) const
inline

Extract the preallocated type for a call or parameter.

Definition at line 1741 of file InstrTypes.h.

References Attrs, getArgOperand(), llvm::AttributeList::getParamPreallocatedType(), llvm::Type::getPointerElementType(), and llvm::Value::getType().

◆ getRetAlign()

MaybeAlign llvm::CallBase::getRetAlign ( ) const
inline

Extract the alignment of the return value.

Definition at line 1719 of file InstrTypes.h.

References Attrs, and llvm::AttributeList::getRetAlignment().

◆ getReturnedArgOperand()

Value * CallBase::getReturnedArgOperand ( ) const

If one of the arguments has the 'returned' attribute, returns its operand value.

Otherwise, return nullptr.

Definition at line 325 of file Instructions.cpp.

References Attrs, F, llvm::AttributeList::FirstArgIndex, getArgOperand(), getCalledFunction(), llvm::AttributeList::hasAttrSomewhere(), and Index.

◆ hasArgument()

bool llvm::CallBase::hasArgument ( const Value V) const
inline

Returns true if this CallSite passes the given Value* as an argument to the called function.

Definition at line 1385 of file InstrTypes.h.

References args(), and llvm::is_contained().

◆ hasByValArgument()

bool llvm::CallBase::hasByValArgument ( ) const
inline

Determine if any call argument is an aggregate passed by value.

Definition at line 1884 of file InstrTypes.h.

References Attrs, and llvm::AttributeList::hasAttrSomewhere().

◆ hasClobberingOperandBundles()

bool llvm::CallBase::hasClobberingOperandBundles ( ) const
inline

Return true if this operand bundle user has operand bundles that may write to the heap.

Definition at line 2029 of file InstrTypes.h.

References bundle_op_infos(), llvm::LLVMContext::OB_deopt, and llvm::LLVMContext::OB_funclet.

Referenced by isFnAttrDisallowedByOpBundle().

◆ hasDescriptor()

bool llvm::CallBase::hasDescriptor ( ) const
inlineprotected

Definition at line 1187 of file InstrTypes.h.

References llvm::Value::HasDescriptor.

Referenced by bundle_op_info_begin(), and bundle_op_info_end().

◆ hasFnAttr() [1/2]

bool llvm::CallBase::hasFnAttr ( Attribute::AttrKind  Kind) const
inline

Determine whether this call has the given attribute.

If it does not then determine if the called function has the attribute, but only if the attribute is allowed for the call.

Definition at line 1481 of file InstrTypes.h.

References assert().

Referenced by cannotDuplicate(), cannotMerge(), llvm::CallInst::canReturnTwice(), doesNoCfCheck(), doesNotAccessMemory(), doesNotReadMemory(), doesNotReturn(), doesNotThrow(), InstrBreaksNoFree(), InstrBreaksNoSync(), isConvergent(), isNoInline(), isStrictFP(), isTrigLibCall(), onlyAccessesArgMemory(), onlyAccessesInaccessibleMemOrArgMem(), onlyAccessesInaccessibleMemory(), onlyReadsMemory(), and llvm::InstCombinerImpl::visitFree().

◆ hasFnAttr() [2/2]

bool llvm::CallBase::hasFnAttr ( StringRef  Kind) const
inline

Determine whether this call has the given attribute.

If it does not then determine if the called function has the attribute, but only if the attribute is allowed for the call.

Definition at line 1490 of file InstrTypes.h.

◆ hasIdenticalOperandBundleSchema()

bool llvm::CallBase::hasIdenticalOperandBundleSchema ( const CallBase Other) const
inline

Return true if Other has the same sequence of operand bundle tags with the same number of operands on each one of them as this OperandBundleUser.

Definition at line 2054 of file InstrTypes.h.

References bundle_op_info_begin(), bundle_op_info_end(), llvm::lltok::equal, getNumOperandBundles(), and Other.

◆ hasInAllocaArgument()

bool llvm::CallBase::hasInAllocaArgument ( ) const
inline

Determine if there are is an inalloca argument.

Only the last argument can have the inalloca attribute.

Definition at line 1687 of file InstrTypes.h.

References arg_empty(), arg_size(), and paramHasAttr().

◆ hasOperandBundles()

bool llvm::CallBase::hasOperandBundles ( ) const
inline

◆ hasOperandBundlesOtherThan()

bool llvm::CallBase::hasOperandBundlesOtherThan ( ArrayRef< uint32_t IDs) const
inline

Return true if this operand bundle user contains operand bundles with tags other than those specified in IDs.

Definition at line 2064 of file InstrTypes.h.

References llvm::numbers::e, getNumOperandBundles(), getOperandBundleAt(), llvm::OperandBundleUse::getTagID(), i, and llvm::is_contained().

Referenced by markTails().

◆ hasReadingOperandBundles()

bool CallBase::hasReadingOperandBundles ( ) const

Return true if this operand bundle user has operand bundles that may read from the heap.

Definition at line 469 of file Instructions.cpp.

References getIntrinsicID(), and hasOperandBundles().

Referenced by isFnAttrDisallowedByOpBundle().

◆ hasRetAttr() [1/2]

bool llvm::CallBase::hasRetAttr ( Attribute::AttrKind  Kind) const
inline

Determine whether the return value has the given attribute.

Definition at line 1583 of file InstrTypes.h.

Referenced by dataOperandHasImpliedAttr(), isFunctionMallocLike(), and isReturnNonNull().

◆ hasRetAttr() [2/2]

bool llvm::CallBase::hasRetAttr ( StringRef  Kind) const
inline

Determine whether the return value has the given attribute.

Definition at line 1587 of file InstrTypes.h.

◆ hasStructRetAttr()

bool llvm::CallBase::hasStructRetAttr ( ) const
inline

Determine if the call returns a structure through first pointer argument.

Definition at line 1875 of file InstrTypes.h.

References getNumArgOperands(), and paramHasAttr().

◆ Instruction() [1/3]

llvm::Instruction::Instruction
protecteddelete

◆ Instruction() [2/3]

Instruction::Instruction
protected

Definition at line 36 of file Instruction.cpp.

◆ Instruction() [3/3]

Instruction::Instruction
protected

Definition at line 24 of file Instruction.cpp.

◆ isArgOperand() [1/2]

bool llvm::CallBase::isArgOperand ( const Use U) const
inline

Definition at line 1361 of file InstrTypes.h.

References arg_begin(), arg_end(), and assert().

Referenced by getArgOperandNo(), and isArgOperand().

◆ isArgOperand() [2/2]

bool llvm::CallBase::isArgOperand ( Value::const_user_iterator  UI) const
inline

Definition at line 1366 of file InstrTypes.h.

References isArgOperand().

◆ isBundleOperand() [1/3]

bool llvm::CallBase::isBundleOperand ( const Use U) const
inline

Returns true if the use is a bundle operand.

Definition at line 1924 of file InstrTypes.h.

References assert(), hasOperandBundles(), isBundleOperand(), and llvm::User::op_begin().

◆ isBundleOperand() [2/3]

bool llvm::CallBase::isBundleOperand ( unsigned  Idx) const
inline

Return true if the operand at index Idx is a bundle operand.

Definition at line 1918 of file InstrTypes.h.

References getBundleOperandsEndIndex(), getBundleOperandsStartIndex(), and hasOperandBundles().

Referenced by isBundleOperand().

◆ isBundleOperand() [3/3]

bool llvm::CallBase::isBundleOperand ( Value::const_user_iterator  UI) const
inline

Definition at line 1929 of file InstrTypes.h.

References isBundleOperand().

◆ isByValArgument()

bool llvm::CallBase::isByValArgument ( unsigned  ArgNo) const
inline

Determine whether this argument is passed by value.

Definition at line 1657 of file InstrTypes.h.

References paramHasAttr().

Referenced by llvm::InlineFunction().

◆ isCallee() [1/2]

bool llvm::CallBase::isCallee ( const Use U) const
inline

Determine whether this Use is the callee operand's Use.

Definition at line 1409 of file InstrTypes.h.

References getCalledOperandUse().

◆ isCallee() [2/2]

bool llvm::CallBase::isCallee ( Value::const_user_iterator  UI) const
inline

Determine whether the passed iterator points to the callee operand's Use.

Definition at line 1404 of file InstrTypes.h.

Referenced by llvm::AbstractCallSite::AbstractCallSite(), llvm::AbstractCallSite::isCallee(), and promoteArguments().

◆ isConvergent()

bool llvm::CallBase::isConvergent ( ) const
inline

Determine if the invoke is convergent.

Definition at line 1865 of file InstrTypes.h.

References llvm::MCID::Convergent, and hasFnAttr().

Referenced by canSplitCallSite(), and InstrBreaksNonConvergent().

◆ isDataOperand() [1/2]

bool llvm::CallBase::isDataOperand ( const Use U) const
inline

Definition at line 1283 of file InstrTypes.h.

References assert(), data_operands_begin(), and data_operands_end().

Referenced by getDataOperandNo(), and isDataOperand().

◆ isDataOperand() [2/2]

bool llvm::CallBase::isDataOperand ( Value::const_user_iterator  UI) const
inline

Definition at line 1288 of file InstrTypes.h.

References isDataOperand().

◆ isFnAttrDisallowedByOpBundle() [1/2]

bool llvm::CallBase::isFnAttrDisallowedByOpBundle ( Attribute::AttrKind  A) const
inline

Is the function attribute A disallowed by some operand bundle on this operand bundle user?

Definition at line 2083 of file InstrTypes.h.

References hasClobberingOperandBundles(), hasReadingOperandBundles(), llvm_unreachable, and llvm::orc::ReadOnly.

◆ isFnAttrDisallowedByOpBundle() [2/2]

bool llvm::CallBase::isFnAttrDisallowedByOpBundle ( StringRef  S) const
inline

Is the function attribute S disallowed by some operand bundle on this operand bundle user?

Definition at line 2075 of file InstrTypes.h.

◆ isInAllocaArgument()

bool llvm::CallBase::isInAllocaArgument ( unsigned  ArgNo) const
inline

Determine whether this argument is passed in an alloca.

Definition at line 1662 of file InstrTypes.h.

References paramHasAttr().

◆ isIndirectCall()

bool CallBase::isIndirectCall ( ) const

◆ isInlineAsm()

bool llvm::CallBase::isInlineAsm ( ) const
inline

Check if this call is an inline asm statement.

Definition at line 1462 of file InstrTypes.h.

References getCalledOperand().

Referenced by HandleCallsInBlockInlinedThroughInvoke(), llvm::GCNTTIImpl::isAlwaysUniform(), isIndirectCall(), shouldBeMustTail(), and shouldConvertUse().

◆ isMustTailCall()

bool CallBase::isMustTailCall ( ) const

◆ isNoBuiltin()

bool llvm::CallBase::isNoBuiltin ( ) const
inline

Return true if the call should not be treated as a call to a builtin.

Definition at line 1774 of file InstrTypes.h.

Referenced by addMappingsFromTLI(), llvm::TargetLibraryInfo::getLibFunc(), llvm::LoopVectorizationCostModel::getVectorCallCost(), getVectorCallCosts(), and llvm::LibCallSimplifier::optimizeCall().

◆ isNoInline()

bool llvm::CallBase::isNoInline ( ) const
inline

Return true if the call should not be inlined.

Definition at line 1783 of file InstrTypes.h.

References hasFnAttr().

◆ isPassingUndefUB()

bool llvm::CallBase::isPassingUndefUB ( unsigned  ArgNo) const
inline

Determine whether passing undef to this argument is undefined behavior.

If passing undef to this argument is UB, passing poison is UB as well because poison is more undefined than undef.

Definition at line 1677 of file InstrTypes.h.

References paramHasAttr().

◆ isPassPointeeByValueArgument()

bool llvm::CallBase::isPassPointeeByValueArgument ( unsigned  ArgNo) const
inline

Determine whether this argument is passed by value, in an alloca, or is preallocated.

Definition at line 1668 of file InstrTypes.h.

References paramHasAttr().

◆ isReturnNonNull()

bool CallBase::isReturnNonNull ( ) const

Return true if the return value is known to be not null.

This may be because it has the nonnull attribute, or because at least one byte is dereferenceable and the pointer is in addrspace(0).

Definition at line 313 of file Instructions.cpp.

References getCaller(), getDereferenceableBytes(), llvm::Value::getType(), hasRetAttr(), llvm::NullPointerIsDefined(), and llvm::AttributeList::ReturnIndex.

◆ isStrictFP()

bool llvm::CallBase::isStrictFP ( ) const
inline

Determine if the call requires strict floating point semantics.

Definition at line 1780 of file InstrTypes.h.

References hasFnAttr().

Referenced by llvm::GCNTTIImpl::instCombineIntrinsic().

◆ isTailCall()

bool CallBase::isTailCall ( ) const

Tests if this call site is marked as a tail call.

Definition at line 301 of file Instructions.cpp.

Referenced by llvm::CallLowering::lowerCall().

◆ LLVM_ATTRIBUTE_DEPRECATED() [1/2]

llvm::CallBase::LLVM_ATTRIBUTE_DEPRECATED ( unsigned getParamAlignment(unsigned ArgNo) const  ,
"Use getParamAlign() instead"   
)
inline

Extract the alignment for a call or parameter (0=unknown).

Definition at line 1722 of file InstrTypes.h.

References Attrs, and llvm::AttributeList::getParamAlignment().

◆ LLVM_ATTRIBUTE_DEPRECATED() [2/2]

llvm::CallBase::LLVM_ATTRIBUTE_DEPRECATED ( unsigned getRetAlignment() const  ,
"Use getRetAlign() instead"   
)
inline

Definition at line 1711 of file InstrTypes.h.

References Attrs, and llvm::AttributeList::getRetAlignment().

◆ mutateFunctionType()

void llvm::CallBase::mutateFunctionType ( FunctionType FTy)
inline

Definition at line 1246 of file InstrTypes.h.

References FTy, llvm::FunctionType::getReturnType(), and llvm::Value::mutateType().

Referenced by llvm::promoteCall().

◆ onlyAccessesArgMemory()

bool llvm::CallBase::onlyAccessesArgMemory ( ) const
inline

Determine if the call can access memmory only using pointers based on its arguments.

Definition at line 1812 of file InstrTypes.h.

References hasFnAttr().

◆ onlyAccessesInaccessibleMemOrArgMem()

bool llvm::CallBase::onlyAccessesInaccessibleMemOrArgMem ( ) const
inline

Determine if the function may only access memory that is either inaccessible from the IR or pointed to by its arguments.

Definition at line 1830 of file InstrTypes.h.

References hasFnAttr().

◆ onlyAccessesInaccessibleMemory()

bool llvm::CallBase::onlyAccessesInaccessibleMemory ( ) const
inline

Determine if the function may only access memory that is inaccessible from the IR.

Definition at line 1821 of file InstrTypes.h.

References hasFnAttr().

◆ onlyReadsMemory() [1/2]

bool llvm::CallBase::onlyReadsMemory ( ) const
inline

Determine if the call does not access or only reads memory.

Definition at line 1794 of file InstrTypes.h.

References doesNotAccessMemory(), hasFnAttr(), and llvm::orc::ReadOnly.

◆ onlyReadsMemory() [2/2]

bool llvm::CallBase::onlyReadsMemory ( unsigned  OpNo) const
inline

◆ operandBundleFromBundleOpInfo()

OperandBundleUse llvm::CallBase::operandBundleFromBundleOpInfo ( const BundleOpInfo BOI) const
inline

◆ paramHasAttr()

bool CallBase::paramHasAttr ( unsigned  ArgNo,
Attribute::AttrKind  Kind 
) const

◆ populateBundleOperandInfos()

CallBase::op_iterator CallBase::populateBundleOperandInfos ( ArrayRef< OperandBundleDef Bundles,
const unsigned  BeginIndex 
)

Populate the BundleOpInfo instances and the Use& vector from Bundles.

Return the op_iterator pointing to the Use& one past the last last bundle operand use.

Each OperandBundleDef instance is tracked by a OperandBundleInfo instance allocated in this User's descriptor.

Definition at line 368 of file Instructions.cpp.

References assert(), B, bundle_op_infos(), copy, llvm::Value::getContext(), llvm::User::op_begin(), and llvm::LLVMContext::pImpl.

◆ removeAttribute() [1/2]

void llvm::CallBase::removeAttribute ( unsigned  i,
Attribute::AttrKind  Kind 
)
inline

removes the attribute from the list of attributes.

Definition at line 1523 of file InstrTypes.h.

References getAttributes(), llvm::Value::getContext(), i, llvm::AttributeList::removeAttribute(), and setAttributes().

Referenced by setNotConvergent().

◆ removeAttribute() [2/2]

void llvm::CallBase::removeAttribute ( unsigned  i,
StringRef  Kind 
)
inline

removes the attribute from the list of attributes.

Definition at line 1530 of file InstrTypes.h.

References getAttributes(), llvm::Value::getContext(), i, llvm::AttributeList::removeAttribute(), and setAttributes().

◆ removeAttributes()

void llvm::CallBase::removeAttributes ( unsigned  i,
const AttrBuilder Attrs 
)
inline

◆ removeOperandBundle()

CallBase * CallBase::removeOperandBundle ( CallBase CB,
uint32_t  ID,
Instruction InsertPt = nullptr 
)
static

Create a clone of CB with operand bundle ID removed.

Definition at line 452 of file Instructions.cpp.

References Create(), E, llvm::SmallVectorImpl< T >::emplace_back(), getNumOperandBundles(), getOperandBundleAt(), and I.

Referenced by llvm::objcarc::BundledRetainClaimRVs::eraseInst().

◆ removeParamAttr() [1/2]

void llvm::CallBase::removeParamAttr ( unsigned  ArgNo,
Attribute::AttrKind  Kind 
)
inline

◆ removeParamAttr() [2/2]

void llvm::CallBase::removeParamAttr ( unsigned  ArgNo,
StringRef  Kind 
)
inline

Removes the attribute from the given argument.

Definition at line 1551 of file InstrTypes.h.

References assert(), getAttributes(), llvm::Value::getContext(), getNumArgOperands(), llvm::AttributeList::removeParamAttribute(), and setAttributes().

◆ removeParamUndefImplyingAttrs()

void llvm::CallBase::removeParamUndefImplyingAttrs ( unsigned  ArgNo)
inline

Removes noundef and other attributes that imply undefined behavior if a undef or poison value is passed from the given argument.

Definition at line 1560 of file InstrTypes.h.

References assert(), getAttributes(), llvm::Value::getContext(), getNumArgOperands(), llvm::AttributeList::removeParamUndefImplyingAttributes(), and setAttributes().

◆ returnDoesNotAlias()

bool llvm::CallBase::returnDoesNotAlias ( ) const
inline

Determine if the return value is marked with NoAlias attribute.

Definition at line 1764 of file InstrTypes.h.

References Attrs, llvm::AttributeList::hasAttribute(), and llvm::AttributeList::ReturnIndex.

◆ setArgOperand()

void llvm::CallBase::setArgOperand ( unsigned  i,
Value v 
)
inline

◆ setAttributes()

void llvm::CallBase::setAttributes ( AttributeList  A)
inline

◆ setCalledFunction() [1/3]

void llvm::CallBase::setCalledFunction ( Function Fn)
inline

Sets the function called, including updating the function type.

Definition at line 1432 of file InstrTypes.h.

References llvm::Function::getFunctionType().

Referenced by llvm::GCNTTIImpl::rewriteIntrinsicWithAddressSpace(), setCalledFunction(), llvm::AMDGPULibCalls::useNative(), and llvm::InstCombinerImpl::visitCallInst().

◆ setCalledFunction() [2/3]

void llvm::CallBase::setCalledFunction ( FunctionCallee  Fn)
inline

Sets the function called, including updating the function type.

Definition at line 1437 of file InstrTypes.h.

References llvm::FunctionCallee::getCallee(), llvm::FunctionCallee::getFunctionType(), and setCalledFunction().

◆ setCalledFunction() [3/3]

void llvm::CallBase::setCalledFunction ( FunctionType FTy,
Value Fn 
)
inline

Sets the function called, including updating to the specified function type.

Definition at line 1443 of file InstrTypes.h.

References assert(), FTy, llvm::FunctionType::getReturnType(), llvm::Value::getType(), and setCalledOperand().

◆ setCalledOperand()

void llvm::CallBase::setCalledOperand ( Value V)
inline

◆ setCallingConv()

void llvm::CallBase::setCallingConv ( CallingConv::ID  CC)
inline

◆ setCannotDuplicate()

void llvm::CallBase::setCannotDuplicate ( )
inline

Definition at line 1854 of file InstrTypes.h.

References addAttribute(), and llvm::AttributeList::FunctionIndex.

Referenced by setCannotDuplicate().

◆ setCannotMerge()

void llvm::CallBase::setCannotMerge ( )
inline

Definition at line 1860 of file InstrTypes.h.

References addAttribute(), and llvm::AttributeList::FunctionIndex.

◆ setConvergent()

void llvm::CallBase::setConvergent ( )
inline

◆ setDoesNotAccessMemory()

void llvm::CallBase::setDoesNotAccessMemory ( )
inline

Definition at line 1789 of file InstrTypes.h.

References addAttribute(), and llvm::AttributeList::FunctionIndex.

◆ setDoesNotReadMemory()

void llvm::CallBase::setDoesNotReadMemory ( )
inline

Definition at line 1806 of file InstrTypes.h.

References addAttribute(), and llvm::AttributeList::FunctionIndex.

◆ setDoesNotReturn()

void llvm::CallBase::setDoesNotReturn ( )
inline

Definition at line 1839 of file InstrTypes.h.

References addAttribute(), and llvm::AttributeList::FunctionIndex.

Referenced by addBoundsChecking().

◆ setDoesNotThrow()

void llvm::CallBase::setDoesNotThrow ( )
inline

◆ setIsNoInline()

void llvm::CallBase::setIsNoInline ( )
inline

Definition at line 1784 of file InstrTypes.h.

References addAttribute(), and llvm::AttributeList::FunctionIndex.

◆ setNotConvergent()

void llvm::CallBase::setNotConvergent ( )
inline

◆ setOnlyAccessesArgMemory()

void llvm::CallBase::setOnlyAccessesArgMemory ( )
inline

Definition at line 1815 of file InstrTypes.h.

References addAttribute(), and llvm::AttributeList::FunctionIndex.

◆ setOnlyAccessesInaccessibleMemOrArgMem()

void llvm::CallBase::setOnlyAccessesInaccessibleMemOrArgMem ( )
inline

Definition at line 1833 of file InstrTypes.h.

References addAttribute(), and llvm::AttributeList::FunctionIndex.

◆ setOnlyAccessesInaccessibleMemory()

void llvm::CallBase::setOnlyAccessesInaccessibleMemory ( )
inline

Definition at line 1824 of file InstrTypes.h.

References addAttribute(), and llvm::AttributeList::FunctionIndex.

◆ setOnlyReadsMemory()

void llvm::CallBase::setOnlyReadsMemory ( )
inline

Member Data Documentation

◆ Attrs

AttributeList llvm::CallBase::Attrs
protected

◆ CalledOperandOpEndIdx

constexpr int llvm::CallBase::CalledOperandOpEndIdx = -1
staticconstexprprotected

The last operand is the called operand.

Definition at line 1176 of file InstrTypes.h.

◆ FTy

FunctionType* llvm::CallBase::FTy
protected

Definition at line 1179 of file InstrTypes.h.

Referenced by getFunctionType(), mutateFunctionType(), and setCalledFunction().


The documentation for this class was generated from the following files: