LLVM  4.0.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
llvm::CallInst Class Reference

This class represents a function call, abstracting a target machine's calling convention. More...

#include <Instructions.h>

Inheritance diagram for llvm::CallInst:
[legend]
Collaboration diagram for llvm::CallInst:
[legend]

Public Types

enum  TailCallKind { TCK_None = 0, TCK_Tail = 1, TCK_MustTail = 2, TCK_NoTail = 3 }
 
- 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  BinaryOps
 
enum  MemoryOps
 
enum  CastOps
 
enum  FuncletPadOps
 
enum  OtherOps
 
- Public Types inherited from llvm::User
typedef Useop_iterator
 
typedef const Useconst_op_iterator
 
typedef iterator_range
< op_iterator
op_range
 
typedef iterator_range
< const_op_iterator
const_op_range
 
- Public Types inherited from llvm::Value
enum  ValueTy
 Concrete subclass of this. More...
 
typedef use_iterator_impl< Useuse_iterator
 
typedef use_iterator_impl
< const Use
const_use_iterator
 
typedef user_iterator_impl< Useruser_iterator
 
typedef user_iterator_impl
< const User
const_user_iterator
 

Public Member Functions

 ~CallInst () override
 
FunctionTypegetFunctionType () const
 
void mutateFunctionType (FunctionType *FTy)
 
TailCallKind getTailCallKind () const
 
bool isTailCall () const
 
bool isMustTailCall () const
 
bool isNoTailCall () const
 
void setTailCall (bool isTC=true)
 
void setTailCallKind (TailCallKind TCK)
 
 DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Value)
 Provide fast operand accessors. More...
 
unsigned getNumArgOperands () const
 Return the number of call arguments. More...
 
ValuegetArgOperand (unsigned i) const
 getArgOperand/setArgOperand - Return/set the i-th call argument. More...
 
void setArgOperand (unsigned i, Value *v)
 
op_iterator arg_begin ()
 Return the iterator pointing to the beginning of the argument list. More...
 
op_iterator arg_end ()
 Return the iterator pointing to the end of the argument list. More...
 
iterator_range< op_iteratorarg_operands ()
 Iteration adapter for range-for loops. More...
 
const_op_iterator arg_begin () const
 Return the iterator pointing to the beginning of the argument list. More...
 
const_op_iterator arg_end () const
 Return the iterator pointing to the end of the argument list. More...
 
iterator_range< const_op_iteratorarg_operands () const
 Iteration adapter for range-for loops. More...
 
const UsegetArgOperandUse (unsigned i) const
 Wrappers for getting the Use of a call argument. More...
 
UsegetArgOperandUse (unsigned i)
 
ValuegetReturnedArgOperand () const
 If one of the arguments has the 'returned' attribute, return its operand value. More...
 
CallingConv::ID getCallingConv () const
 getCallingConv/setCallingConv - Get or set the calling convention of this function call. More...
 
void setCallingConv (CallingConv::ID CC)
 
AttributeSet getAttributes () const
 Return the parameter attributes for this call. More...
 
void setAttributes (AttributeSet Attrs)
 Set the parameter attributes for this call. 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 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 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 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...
 
bool paramHasAttr (unsigned i, Attribute::AttrKind Kind) const
 Determine whether the call or the callee has the given attributes. 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...
 
bool dataOperandHasImpliedAttr (unsigned i, Attribute::AttrKind Kind) const
 Return true if the data operand at index i has the attribute A. More...
 
unsigned getParamAlignment (unsigned i) const
 Extract the alignment for a call or parameter (0=unknown). 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 doesNotAlias (unsigned n) const
 Determine if the parameter or return value is marked with NoAlias attribute. More...
 
bool isNoBuiltin () const
 Return true if the call should not be treated as a call to a builtin. More...
 
bool isNoInline () const
 Return true if the call should not be inlined. More...
 
void setIsNoInline ()
 
bool canReturnTwice () const
 Return true if the call can return twice. More...
 
void setCanReturnTwice ()
 
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 doesNotReturn () const
 Determine if the call cannot return. More...
 
void setDoesNotReturn ()
 
bool doesNotThrow () const
 Determine if the call cannot unwind. More...
 
void setDoesNotThrow ()
 
bool cannotDuplicate () const
 Determine if the call cannot be duplicated. More...
 
void setCannotDuplicate ()
 
bool isConvergent () const
 Determine if the call 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...
 
FunctiongetCalledFunction () const
 Return the function called, or null if this is an indirect function invocation. More...
 
const ValuegetCalledValue () const
 Get a pointer to the function that is invoked by this instruction. More...
 
ValuegetCalledValue ()
 
void setCalledFunction (Value *Fn)
 Set the function called. More...
 
void setCalledFunction (FunctionType *FTy, Value *Fn)
 
bool isInlineAsm () const
 Check if this call is an inline asm statement. More...
 
- Public Member Functions inherited from llvm::Instruction
 Instruction (const Instruction &)=delete
 
Instructionoperator= (const Instruction &)=delete
 
 ~Instruction () override
 
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...
 
unsigned getOpcode () const
 Returns a member of one of the enums like Instruction::Add. More...
 
const char * getOpcodeName () const
 
bool isTerminator () const
 
bool isBinaryOp () const
 
bool isShift ()
 
bool isCast () const
 
bool isFuncletPad () 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...
 
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 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 nsw 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...
 
bool isExact () const
 Determine whether the exact flag is set. More...
 
void setHasUnsafeAlgebra (bool B)
 Set or clear the unsafe-algebra 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 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 hasUnsafeAlgebra () const
 Determine whether the unsafe-algebra 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...
 
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)
 Convenience method to copy supported wrapping, exact, and fast-math 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...
 
bool isAssociative () const
 Return true if the instruction is associative: More...
 
bool isCommutative () const
 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 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 isEHPad () const
 Return true if the instruction is a variety of EH-block. More...
 
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...
 
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
 
 ~User () override=default
 
void operator delete (void *Usr)
 Free memory allocated for User and Use objects. More...
 
void operator delete (void *, unsigned)
 Placement delete - required by std, but never called. More...
 
void operator delete (void *, unsigned, bool)
 Placement delete - required by std, but never called. More...
 
UsegetOperandList ()
 
const UsegetOperandList () const
 
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...
 
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_iterator
operand_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
 
void operator= (const Value &)=delete
 
virtual ~Value ()
 
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...
 
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 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 assertModuleIsMaterialized () const
 
bool 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_iterator
materialized_uses () const
 
iterator_range< use_iteratoruses ()
 
iterator_range
< const_use_iterator
uses () 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_iterator
materialized_users () const
 
iterator_range< user_iteratorusers ()
 
iterator_range
< const_user_iterator
users () const
 
bool hasOneUse () const
 Return true if there is exactly one user of this value. More...
 
bool hasNUses (unsigned N) const
 Return true if this Value has exactly N users. More...
 
bool hasNUsesOrMore (unsigned N) const
 Return true if this value has N users or more. 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...
 
ValuestripPointerCasts ()
 Strip off pointer casts, all-zero GEPs, and aliases. More...
 
const ValuestripPointerCasts () const
 
ValuestripPointerCastsNoFollowAliases ()
 Strip off pointer casts and all-zero GEPs. More...
 
const ValuestripPointerCastsNoFollowAliases () const
 
ValuestripInBoundsConstantOffsets ()
 Strip off pointer casts and all-constant inbounds GEPs. More...
 
const ValuestripInBoundsConstantOffsets () const
 
ValuestripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset)
 Accumulate offsets from stripInBoundsConstantOffsets(). More...
 
const ValuestripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) const
 
ValuestripInBoundsOffsets ()
 Strip off pointer casts and inbounds GEPs. More...
 
const ValuestripInBoundsOffsets () const
 
unsigned getPointerDereferenceableBytes (const DataLayout &DL, bool &CanBeNull) const
 Returns the number of bytes known to be dereferenceable for the pointer value. More...
 
unsigned getPointerAlignment (const DataLayout &DL) const
 Returns an alignment of the pointer value. More...
 
ValueDoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB)
 Translate PHI node to its predecessor from the given basic block. More...
 
const ValueDoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) const
 
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...
 
- Public Member Functions inherited from llvm::OperandBundleUser< InstrTy, OpIteratorTy >
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...
 
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 OperandBundleUser< InstrTy, OpIteratorTy > &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...
 

Static Public Member Functions

static CallInstCreate (Value *Func, ArrayRef< Value * > Args, ArrayRef< OperandBundleDef > Bundles=None, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
 
static CallInstCreate (Value *Func, ArrayRef< Value * > Args, const Twine &NameStr, Instruction *InsertBefore=nullptr)
 
static CallInstCreate (FunctionType *Ty, Value *Func, ArrayRef< Value * > Args, const Twine &NameStr, Instruction *InsertBefore=nullptr)
 
static CallInstCreate (FunctionType *Ty, Value *Func, ArrayRef< Value * > Args, ArrayRef< OperandBundleDef > Bundles=None, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
 
static CallInstCreate (Value *Func, ArrayRef< Value * > Args, ArrayRef< OperandBundleDef > Bundles, const Twine &NameStr, BasicBlock *InsertAtEnd)
 
static CallInstCreate (Value *Func, ArrayRef< Value * > Args, const Twine &NameStr, BasicBlock *InsertAtEnd)
 
static CallInstCreate (Value *F, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
 
static CallInstCreate (Value *F, const Twine &NameStr, BasicBlock *InsertAtEnd)
 
static CallInstCreate (CallInst *CI, ArrayRef< OperandBundleDef > Bundles, Instruction *InsertPt=nullptr)
 Create a clone of CI with a different set of operand bundles and insert it before InsertPt. More...
 
static InstructionCreateMalloc (Instruction *InsertBefore, Type *IntPtrTy, Type *AllocTy, Value *AllocSize, Value *ArraySize=nullptr, Function *MallocF=nullptr, const Twine &Name="")
 Generate the IR for a call to malloc: More...
 
static InstructionCreateMalloc (BasicBlock *InsertAtEnd, Type *IntPtrTy, Type *AllocTy, Value *AllocSize, Value *ArraySize=nullptr, Function *MallocF=nullptr, const Twine &Name="")
 CreateMalloc - Generate the IR for a call to malloc: More...
 
static InstructionCreateMalloc (Instruction *InsertBefore, Type *IntPtrTy, Type *AllocTy, Value *AllocSize, Value *ArraySize=nullptr, ArrayRef< OperandBundleDef > Bundles=None, Function *MallocF=nullptr, const Twine &Name="")
 
static InstructionCreateMalloc (BasicBlock *InsertAtEnd, Type *IntPtrTy, Type *AllocTy, Value *AllocSize, Value *ArraySize=nullptr, ArrayRef< OperandBundleDef > Bundles=None, Function *MallocF=nullptr, const Twine &Name="")
 
static InstructionCreateFree (Value *Source, Instruction *InsertBefore)
 Generate the IR for a call to the builtin free function. More...
 
static InstructionCreateFree (Value *Source, BasicBlock *InsertAtEnd)
 CreateFree - Generate the IR for a call to the builtin free function. More...
 
static InstructionCreateFree (Value *Source, ArrayRef< OperandBundleDef > Bundles, Instruction *InsertBefore)
 
static InstructionCreateFree (Value *Source, ArrayRef< OperandBundleDef > Bundles, BasicBlock *InsertAtEnd)
 
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 isBinaryOp (unsigned Opcode)
 
static bool isShift (unsigned Opcode)
 Determine if the Opcode is one of the shift instructions. 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 isAssociative (unsigned op)
 Return true if the instruction is associative: More...
 
static bool isCommutative (unsigned op)
 Return true if the instruction is commutative: More...
 
static bool isIdempotent (unsigned op)
 Return true if the instruction is idempotent: More...
 
static bool isNilpotent (unsigned op)
 Return true if the instruction is nilpotent: More...
 
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)
 

Protected Member Functions

CallInstcloneImpl () const
 
- Protected Member Functions inherited from llvm::Instruction
void setInstructionSubclassData (unsigned short D)
 
unsigned getSubclassDataFromInstruction () const
 
 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...
 
template<int Idx>
UseOp ()
 
template<int Idx>
const UseOp () const
 
- Protected Member Functions inherited from llvm::Value
 Value (Type *Ty, unsigned scid)
 
unsigned short getSubclassDataFromValue () const
 
void setValueSubclassData (unsigned short D)
 
- 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 Member Functions inherited from llvm::OperandBundleUser< InstrTy, OpIteratorTy >
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_iterator
bundle_op_infos ()
 Return the range [bundle_op_info_begin, bundle_op_info_end). More...
 
iterator_range
< const_bundle_op_iterator
bundle_op_infos () const
 Return the range [bundle_op_info_begin, bundle_op_info_end). More...
 
OpIteratorTy populateBundleOperandInfos (ArrayRef< OperandBundleDef > Bundles, const unsigned BeginIndex)
 Populate the BundleOpInfo instances and the Use& vector from Bundles. More...
 
const BundleOpInfogetBundleOpInfoForOperand (unsigned OpIdx) const
 Return the BundleOpInfo for the operand at index OpIdx. More...
 

Friends

class OperandBundleUser< CallInst, User::op_iterator >
 
class Instruction
 

Additional Inherited Members

- Static Public Attributes inherited from llvm::Value
static const unsigned MaxAlignmentExponent = 29
 The maximum alignment for instructions. More...
 
static const unsigned MaximumAlignment = 1u << MaxAlignmentExponent
 
- Protected Types inherited from llvm::Value
enum  : unsigned { NumUserOperandsBits = 28 }
 The number of operands in the subclass. More...
 
- Protected Types inherited from llvm::ilist_node_impl< ilist_detail::compute_node_options< Instruction, Options...>::type >
typedef ilist_iterator
< ilist_detail::compute_node_options
< Instruction, Options...>
::type, false, false
self_iterator
 
typedef ilist_iterator
< ilist_detail::compute_node_options
< Instruction, Options...>
::type, false, true
const_self_iterator
 
typedef ilist_iterator
< ilist_detail::compute_node_options
< Instruction, Options...>
::type, true, false
reverse_self_iterator
 
typedef ilist_iterator
< ilist_detail::compute_node_options
< Instruction, Options...>
::type, true, true
const_reverse_self_iterator
 
- Protected Types inherited from llvm::OperandBundleUser< InstrTy, OpIteratorTy >
typedef BundleOpInfobundle_op_iterator
 
typedef const BundleOpInfoconst_bundle_op_iterator
 
- Static Protected Member Functions inherited from llvm::User
template<int Idx, typename U >
static UseOpFrom (const U *that)
 
- Static Protected Member Functions inherited from llvm::OperandBundleUser< InstrTy, OpIteratorTy >
static unsigned CountBundleInputs (ArrayRef< OperandBundleDef > Bundles)
 Return the total number of values used in Bundles. More...
 
- 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 HasHungOffUses: 1
 
unsigned HasDescriptor: 1
 

Detailed Description

This class represents a function call, abstracting a target machine's calling convention.

This class uses low bit of the SubClassData field to indicate whether or not this is a tail call. The rest of the bits hold the calling convention of the call.

Definition at line 1353 of file Instructions.h.

Member Enumeration Documentation

Enumerator
TCK_None 
TCK_Tail 
TCK_MustTail 
TCK_NoTail 

Definition at line 1531 of file Instructions.h.

Constructor & Destructor Documentation

CallInst::~CallInst ( )
override

Definition at line 245 of file Instructions.cpp.

Member Function Documentation

void CallInst::addAttribute ( unsigned  i,
Attribute::AttrKind  Kind 
)
void CallInst::addAttribute ( unsigned  i,
Attribute  Attr 
)

adds the attribute to the list of attributes.

Definition at line 353 of file Instructions.cpp.

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

void CallInst::addDereferenceableAttr ( unsigned  i,
uint64_t  Bytes 
)

adds the dereferenceable attribute to the list of attributes.

Definition at line 371 of file Instructions.cpp.

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

void CallInst::addDereferenceableOrNullAttr ( unsigned  i,
uint64_t  Bytes 
)

adds the dereferenceable_or_null attribute to the list of attributes.

Definition at line 377 of file Instructions.cpp.

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

op_iterator llvm::CallInst::arg_begin ( )
inline

Return the iterator pointing to the beginning of the argument list.

Definition at line 1581 of file Instructions.h.

References llvm::User::op_begin().

Referenced by arg_operands(), llvm::changeToInvokeAndSplitBasicBlock(), Create(), llvm::InlineFunction(), and MakeGuardControlFlowExplicit().

const_op_iterator llvm::CallInst::arg_begin ( ) const
inline

Return the iterator pointing to the beginning of the argument list.

Definition at line 1595 of file Instructions.h.

References llvm::User::op_begin().

op_iterator llvm::CallInst::arg_end ( )
inline
const_op_iterator llvm::CallInst::arg_end ( ) const
inline

Return the iterator pointing to the end of the argument list.

Definition at line 1598 of file Instructions.h.

References llvm::OperandBundleUser< InstrTy, OpIteratorTy >::getNumTotalBundleOperands(), and llvm::User::op_end().

iterator_range<op_iterator> llvm::CallInst::arg_operands ( )
inline
iterator_range<const_op_iterator> llvm::CallInst::arg_operands ( ) const
inline

Iteration adapter for range-for loops.

Definition at line 1604 of file Instructions.h.

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

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

Determine if the call cannot be duplicated.

Definition at line 1792 of file Instructions.h.

References hasFnAttr().

Referenced by FoldCondBranchOnPHI().

bool llvm::CallInst::canReturnTwice ( ) const
inline

Return true if the call can return twice.

Definition at line 1739 of file Instructions.h.

References hasFnAttr().

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

Definition at line 1852 of file Instructions.h.

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

Referenced by classof().

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

Definition at line 1855 of file Instructions.h.

References classof().

CallInst * CallInst::cloneImpl ( ) const
protected
static CallInst* llvm::CallInst::Create ( Value Func,
ArrayRef< Value * >  Args,
ArrayRef< OperandBundleDef Bundles = None,
const Twine NameStr = "",
Instruction InsertBefore = nullptr 
)
inlinestatic
static CallInst* llvm::CallInst::Create ( Value Func,
ArrayRef< Value * >  Args,
const Twine NameStr,
Instruction InsertBefore = nullptr 
)
inlinestatic

Definition at line 1420 of file Instructions.h.

References Create(), llvm::Value::getType(), and llvm::None.

static CallInst* llvm::CallInst::Create ( FunctionType Ty,
Value Func,
ArrayRef< Value * >  Args,
const Twine NameStr,
Instruction InsertBefore = nullptr 
)
inlinestatic

Definition at line 1428 of file Instructions.h.

References llvm::None, and llvm::ArrayRef< T >::size().

static CallInst* llvm::CallInst::Create ( FunctionType Ty,
Value Func,
ArrayRef< Value * >  Args,
ArrayRef< OperandBundleDef Bundles = None,
const Twine NameStr = "",
Instruction InsertBefore = nullptr 
)
inlinestatic
static CallInst* llvm::CallInst::Create ( Value Func,
ArrayRef< Value * >  Args,
ArrayRef< OperandBundleDef Bundles,
const Twine NameStr,
BasicBlock InsertAtEnd 
)
inlinestatic
static CallInst* llvm::CallInst::Create ( Value Func,
ArrayRef< Value * >  Args,
const Twine NameStr,
BasicBlock InsertAtEnd 
)
inlinestatic

Definition at line 1458 of file Instructions.h.

References llvm::None, and llvm::ArrayRef< T >::size().

static CallInst* llvm::CallInst::Create ( Value F,
const Twine NameStr = "",
Instruction InsertBefore = nullptr 
)
inlinestatic

Definition at line 1464 of file Instructions.h.

static CallInst* llvm::CallInst::Create ( Value F,
const Twine NameStr,
BasicBlock InsertAtEnd 
)
inlinestatic

Definition at line 1469 of file Instructions.h.

CallInst * CallInst::Create ( CallInst CI,
ArrayRef< OperandBundleDef Bundles,
Instruction InsertPt = nullptr 
)
static

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

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

Definition at line 320 of file Instructions.cpp.

References arg_begin(), arg_end(), AMDGPU::RuntimeMD::KeyName::Args, Create(), getAttributes(), getCalledValue(), getCallingConv(), llvm::Instruction::getDebugLoc(), llvm::Value::getName(), getTailCallKind(), setTailCallKind(), and llvm::Value::SubclassOptionalData.

Instruction * CallInst::CreateFree ( Value Source,
Instruction InsertBefore 
)
static

Generate the IR for a call to the builtin free function.

CreateFree - Generate the IR for a call to the builtin free function.

Definition at line 583 of file Instructions.cpp.

References createFree(), and llvm::None.

Referenced by LLVMBuildFree(), and PerformHeapAllocSRoA().

Instruction * CallInst::CreateFree ( Value Source,
BasicBlock InsertAtEnd 
)
static

CreateFree - Generate the IR for a call to the builtin free function.

Note: This function does not add the call to the basic block, that is the responsibility of the caller.

Definition at line 595 of file Instructions.cpp.

References assert(), createFree(), and llvm::None.

Instruction * CallInst::CreateFree ( Value Source,
ArrayRef< OperandBundleDef Bundles,
Instruction InsertBefore 
)
static

Definition at line 586 of file Instructions.cpp.

References createFree().

Instruction * CallInst::CreateFree ( Value Source,
ArrayRef< OperandBundleDef Bundles,
BasicBlock InsertAtEnd 
)
static

Definition at line 600 of file Instructions.cpp.

References assert(), and createFree().

Instruction * CallInst::CreateMalloc ( Instruction InsertBefore,
Type IntPtrTy,
Type AllocTy,
Value AllocSize,
Value ArraySize = nullptr,
Function MallocF = nullptr,
const Twine Name = "" 
)
static

Generate the IR for a call to malloc:

CreateMalloc - Generate the IR for a call to malloc:

  1. Compute the malloc call's argument as the specified type's size, possibly multiplied by the array size if the array size is not constant 1.
  2. Call malloc with that argument.
  3. Bitcast the result of the malloc call to the specified type.

Definition at line 505 of file Instructions.cpp.

References createMalloc(), and llvm::None.

Referenced by LLVMBuildArrayMalloc(), LLVMBuildMalloc(), PerformHeapAllocSRoA(), and tryToOptimizeStoreOfMallocToGlobal().

Instruction * CallInst::CreateMalloc ( BasicBlock InsertAtEnd,
Type IntPtrTy,
Type AllocTy,
Value AllocSize,
Value ArraySize = nullptr,
Function MallocF = nullptr,
const Twine Name = "" 
)
static

CreateMalloc - Generate the IR for a call to malloc:

  1. Compute the malloc call's argument as the specified type's size, possibly multiplied by the array size if the array size is not constant 1.
  2. Call malloc with that argument.
  3. Bitcast the result of the malloc call to the specified type. Note: This function does not add the bitcast to the basic block, that is the responsibility of the caller.

Definition at line 532 of file Instructions.cpp.

References createMalloc(), and llvm::None.

Instruction * CallInst::CreateMalloc ( Instruction InsertBefore,
Type IntPtrTy,
Type AllocTy,
Value AllocSize,
Value ArraySize = nullptr,
ArrayRef< OperandBundleDef Bundles = None,
Function MallocF = nullptr,
const Twine Name = "" 
)
static

Definition at line 513 of file Instructions.cpp.

References createMalloc().

Instruction * CallInst::CreateMalloc ( BasicBlock InsertAtEnd,
Type IntPtrTy,
Type AllocTy,
Value AllocSize,
Value ArraySize = nullptr,
ArrayRef< OperandBundleDef Bundles = None,
Function MallocF = nullptr,
const Twine Name = "" 
)
static

Definition at line 539 of file Instructions.cpp.

References createMalloc().

bool CallInst::dataOperandHasImpliedAttr ( unsigned  i,
Attribute::AttrKind  Kind 
) const

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 393 of file Instructions.cpp.

References assert(), llvm::OperandBundleUser< InstrTy, OpIteratorTy >::bundleOperandHasAttr(), llvm::OperandBundleUser< InstrTy, OpIteratorTy >::getBundleOperandsStartIndex(), getNumArgOperands(), llvm::User::getNumOperands(), llvm::OperandBundleUser< InstrTy, OpIteratorTy >::hasOperandBundles(), and paramHasAttr().

llvm::CallInst::DECLARE_TRANSPARENT_OPERAND_ACCESSORS ( Value  )

Provide fast operand accessors.

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

Determine if the call does not access memory.

Definition at line 1747 of file Instructions.h.

References hasFnAttr().

Referenced by doesNotReadMemory(), markTails(), and onlyReadsMemory().

bool llvm::CallInst::doesNotAlias ( unsigned  n) const
inline

Determine if the parameter or return value is marked with NoAlias attribute.

Parameters
nThe parameter to check. 1 is the first parameter, 0 is the return

Definition at line 1721 of file Instructions.h.

References llvm::AttributeSet::hasAttribute(), and llvm::NoAlias.

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

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

Definition at line 1763 of file Instructions.h.

References doesNotAccessMemory(), hasFnAttr(), and AMDGPU::RuntimeMD::KernelArg::WriteOnly.

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

Determine if the call cannot return.

Definition at line 1780 of file Instructions.h.

References hasFnAttr().

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

Determine if the call cannot unwind.

Definition at line 1786 of file Instructions.h.

References hasFnAttr().

Referenced by HandleCallsInBlockInlinedThroughInvoke(), and llvm::InstCombiner::visitCallInst().

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

getArgOperand/setArgOperand - Return/set the i-th call argument.

Definition at line 1571 of file Instructions.h.

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

Referenced by computeArraySize(), computeKnownBitsFromAssume(), llvm::computeUsesVAFloatArgument(), detectLog2OfHalf(), eliminateRecursiveTailCall(), llvm::AlignmentFromAssumptionsPass::extractAlignmentInfo(), llvm::findDevirtualizableCallsForTypeCheckedLoad(), llvm::findDevirtualizableCallsForTypeTest(), foldCttzCtlz(), foldMallocMemset(), llvm::MemIntrinsic::getAlignmentCst(), llvm::MemIntrinsic::getAlignmentType(), llvm::VAStartInst::getArgList(), llvm::VAEndInst::getArgList(), llvm::GCRelocateInst::getBasePtrIndex(), llvm::GCRelocateInst::getDerivedPtrIndex(), llvm::VACopyInst::getDest(), llvm::InstrProfIncrementInst::getHash(), llvm::InstrProfValueProfileInst::getHash(), llvm::InstrProfIncrementInst::getIndex(), llvm::InstrProfValueProfileInst::getIndex(), llvm::MemIntrinsic::getLength(), getLocForWrite(), llvm::InstrProfIncrementInst::getName(), llvm::InstrProfValueProfileInst::getName(), llvm::InstrProfIncrementInst::getNumCounters(), llvm::DbgValueInst::getOffset(), llvm::AArch64TTIImpl::getOrCreateResultFromMemIntrinsic(), llvm::MemIntrinsic::getRawDest(), llvm::DbgDeclareInst::getRawExpression(), llvm::DbgValueInst::getRawExpression(), llvm::MemTransferInst::getRawSource(), llvm::DbgDeclareInst::getRawVariable(), llvm::DbgValueInst::getRawVariable(), getReturnedArgOperand(), llvm::VACopyInst::getSrc(), llvm::GCProjectionInst::getStatepoint(), llvm::InstrProfIncrementInst::getStep(), llvm::InstrProfValueProfileInst::getTargetValue(), llvm::AArch64TTIImpl::getTgtMemIntrinsic(), llvm::AArch64TargetLowering::getTgtMemIntrinsic(), llvm::ARMTargetLowering::getTgtMemIntrinsic(), llvm::NVPTXTargetLowering::getTgtMemIntrinsic(), llvm::PPCTargetLowering::getTgtMemIntrinsic(), llvm::X86TargetLowering::getTgtMemIntrinsic(), llvm::MemSetInst::getValue(), llvm::InstrProfValueProfileInst::getValueKind(), llvm::DbgInfoIntrinsic::getVariableLocation(), llvm::MemIntrinsic::getVolatileCst(), handleBrSelExpect(), handleFree(), handleSwitchExpect(), haveSameOperands(), InTreeUserNeedToExtract(), isDynamicConstant(), isReportingError(), llvm::GCProjectionInst::isTiedToInvoke(), lowerExpectIntrinsic(), llvm::IntrinsicLowering::LowerIntrinsicCall(), llvm::lowerObjectSizeCall(), llvm::IntrinsicLowering::LowerToByteSwap(), MakeGuardControlFlowExplicit(), optimizeBinaryDoubleFP(), OptimizeEmptyGlobalCXXDtors(), optimizeUnaryDoubleFP(), PerformHeapAllocSRoA(), ReplaceFPIntrinsicWithCall(), scalarizeMaskedGather(), scalarizeMaskedLoad(), scalarizeMaskedScatter(), scalarizeMaskedStore(), llvm::FastISel::selectIntrinsicCall(), llvm::FastISel::selectPatchpoint(), simplifyMaskedGather(), simplifyMaskedLoad(), simplifyMaskedScatter(), simplifyMaskedStore(), simplifyMinnumMaxnum(), simplifyX86immShift(), simplifyX86insertps(), simplifyX86movmsk(), simplifyX86pshufb(), simplifyX86varShift(), simplifyX86vpcom(), simplifyX86vperm2(), simplifyX86vpermilvar(), simplifyX86vpermv(), tryToMoveFreeBeforeNullTest(), tryToOptimizeStoreOfMallocToGlobal(), llvm::AssumptionCache::updateAffectedValues(), upgradeIntMinMax(), llvm::UpgradeIntrinsicCall(), upgradeMaskedCompare(), upgradeMaskedMove(), UpgradeX86MaskedShift(), llvm::InstCombiner::visitCallInst(), llvm::InstCombiner::visitFCmpInst(), llvm::InstCombiner::visitFPTrunc(), and llvm::InstCombiner::visitFree().

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

Definition at line 1613 of file Instructions.h.

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

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

Get the attribute of a given kind at a position.

Definition at line 1677 of file Instructions.h.

References llvm::AttributeSet::getAttribute(), and getAttributes().

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

Get the attribute of a given kind at a position.

Definition at line 1682 of file Instructions.h.

References llvm::AttributeSet::getAttribute(), and getAttributes().

AttributeSet llvm::CallInst::getAttributes ( ) const
inline
Function* llvm::CallInst::getCalledFunction ( ) const
inline
const Value* llvm::CallInst::getCalledValue ( ) const
inline
Value* llvm::CallInst::getCalledValue ( )
inline

Definition at line 1831 of file Instructions.h.

References llvm::User::Op().

CallingConv::ID llvm::CallInst::getCallingConv ( ) const
inline
uint64_t llvm::CallInst::getDereferenceableBytes ( unsigned  i) const
inline

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

Definition at line 1708 of file Instructions.h.

References llvm::AttributeSet::getDereferenceableBytes().

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

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

Definition at line 1714 of file Instructions.h.

References llvm::AttributeSet::getDereferenceableOrNullBytes().

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

Definition at line 1523 of file Instructions.h.

Referenced by isCallingConvCCompatible().

unsigned llvm::CallInst::getNumArgOperands ( ) const
inline
unsigned llvm::CallInst::getParamAlignment ( unsigned  i) const
inline

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

Definition at line 1702 of file Instructions.h.

References llvm::AttributeSet::getParamAlignment().

Value * CallInst::getReturnedArgOperand ( ) const

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

Otherwise, return nullptr.

Definition at line 334 of file Instructions.cpp.

References F, getArgOperand(), getCalledFunction(), and llvm::AttributeSet::hasAttrSomewhere().

TailCallKind llvm::CallInst::getTailCallKind ( ) const
inline
bool llvm::CallInst::hasByValArgument ( ) const
inline

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

Definition at line 1817 of file Instructions.h.

References llvm::AttributeSet::hasAttrSomewhere().

bool llvm::CallInst::hasFnAttr ( Attribute::AttrKind  Kind) const
inline
bool llvm::CallInst::hasFnAttr ( StringRef  Kind) const
inline

Determine whether this call has the given attribute.

Definition at line 1669 of file Instructions.h.

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

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

Definition at line 1808 of file Instructions.h.

References getNumArgOperands(), and paramHasAttr().

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

Determine if the call is convergent.

Definition at line 1798 of file Instructions.h.

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

Referenced by FoldCondBranchOnPHI().

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

Check if this call is an inline asm statement.

Definition at line 1847 of file Instructions.h.

References llvm::User::Op().

Referenced by needsStatepoint().

bool llvm::CallInst::isMustTailCall ( ) const
inline
bool llvm::CallInst::isNoBuiltin ( ) const
inline

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

Definition at line 1727 of file Instructions.h.

Referenced by getVectorCallCost(), and llvm::LibCallSimplifier::optimizeCall().

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

Return true if the call should not be inlined.

Definition at line 1733 of file Instructions.h.

References hasFnAttr().

bool llvm::CallInst::isNoTailCall ( ) const
inline

Definition at line 1546 of file Instructions.h.

References llvm::Instruction::getSubclassDataFromInstruction(), and TCK_NoTail.

Referenced by markTails().

bool llvm::CallInst::isTailCall ( ) const
inline
void llvm::CallInst::mutateFunctionType ( FunctionType FTy)
inline
bool llvm::CallInst::onlyAccessesArgMemory ( ) const
inline

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

Definition at line 1772 of file Instructions.h.

References hasFnAttr().

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

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

Definition at line 1755 of file Instructions.h.

References doesNotAccessMemory(), hasFnAttr(), and AMDGPU::RuntimeMD::KernelArg::ReadOnly.

Referenced by optimizeSQRT().

bool CallInst::paramHasAttr ( unsigned  i,
Attribute::AttrKind  Kind 
) const

Determine whether the call or the callee has the given attributes.

Definition at line 383 of file Instructions.cpp.

References assert(), F, getCalledFunction(), getNumArgOperands(), and llvm::AttributeSet::hasAttribute().

Referenced by dataOperandHasImpliedAttr(), and hasStructRetAttr().

void CallInst::removeAttribute ( unsigned  i,
Attribute::AttrKind  Kind 
)

removes the attribute from the list of attributes.

Definition at line 359 of file Instructions.cpp.

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

Referenced by setNotConvergent().

void CallInst::removeAttribute ( unsigned  i,
StringRef  Kind 
)

removes the attribute from the list of attributes.

Definition at line 365 of file Instructions.cpp.

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

void llvm::CallInst::setArgOperand ( unsigned  i,
Value v 
)
inline
void llvm::CallInst::setAttributes ( AttributeSet  Attrs)
inline
void llvm::CallInst::setCalledFunction ( Value Fn)
inline

Set the function called.

Definition at line 1834 of file Instructions.h.

References llvm::Value::getType().

Referenced by llvm::InstCombiner::visitCallInst().

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

Definition at line 1839 of file Instructions.h.

References assert(), llvm::Value::getType(), and llvm::User::Op().

void llvm::CallInst::setCallingConv ( CallingConv::ID  CC)
inline
void llvm::CallInst::setCannotDuplicate ( )
inline

Definition at line 1793 of file Instructions.h.

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

void llvm::CallInst::setCanReturnTwice ( )
inline

Definition at line 1742 of file Instructions.h.

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

void llvm::CallInst::setConvergent ( )
inline
void llvm::CallInst::setDoesNotAccessMemory ( )
inline

Definition at line 1750 of file Instructions.h.

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

void llvm::CallInst::setDoesNotReadMemory ( )
inline
void llvm::CallInst::setDoesNotReturn ( )
inline

Definition at line 1781 of file Instructions.h.

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

Referenced by INITIALIZE_PASS().

void llvm::CallInst::setDoesNotThrow ( )
inline
void llvm::CallInst::setIsNoInline ( )
inline

Definition at line 1734 of file Instructions.h.

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

void llvm::CallInst::setNotConvergent ( )
inline
void llvm::CallInst::setOnlyAccessesArgMemory ( )
inline

Definition at line 1775 of file Instructions.h.

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

void llvm::CallInst::setOnlyReadsMemory ( )
inline
void llvm::CallInst::setTailCall ( bool  isTC = true)
inline
void llvm::CallInst::setTailCallKind ( TailCallKind  TCK)
inline

Friends And Related Function Documentation

friend class Instruction
friend

Definition at line 1404 of file Instructions.h.

friend class OperandBundleUser< CallInst, User::op_iterator >
friend

Definition at line 1355 of file Instructions.h.


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