|
LLVM
3.7.0
|
CallInst - This class represents a function call, abstracting a target machine's calling convention. More...
#include <Instructions.h>
Public Types | |
| enum | TailCallKind { TCK_None = 0, TCK_Tail = 1, TCK_MustTail = 2 } |
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 | OtherOps |
Public Types inherited from llvm::User | |
| typedef Use * | op_iterator |
| typedef const Use * | const_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< Use > | use_iterator |
| typedef use_iterator_impl < const Use > | const_use_iterator |
| typedef user_iterator_impl< User > | user_iterator |
| typedef user_iterator_impl < const User > | const_user_iterator |
Public Member Functions | |
| ~CallInst () override | |
| FunctionType * | getFunctionType () const |
| void | mutateFunctionType (FunctionType *FTy) |
| TailCallKind | getTailCallKind () const |
| bool | isTailCall () const |
| bool | isMustTailCall () const |
| void | setTailCall (bool isTC=true) |
| void | setTailCallKind (TailCallKind TCK) |
| DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Value) | |
| Provide fast operand accessors. More... | |
| unsigned | getNumArgOperands () const |
| getNumArgOperands - Return the number of call arguments. More... | |
| Value * | getArgOperand (unsigned i) const |
| getArgOperand/setArgOperand - Return/set the i-th call argument. More... | |
| void | setArgOperand (unsigned i, Value *v) |
| iterator_range< op_iterator > | arg_operands () |
| arg_operands - iteration adapter for range-for loops. More... | |
| iterator_range< const_op_iterator > | arg_operands () const |
| arg_operands - iteration adapter for range-for loops. More... | |
| const Use & | getArgOperandUse (unsigned i) const |
Wrappers for getting the Use of a call argument. More... | |
| Use & | getArgOperandUse (unsigned i) |
| CallingConv::ID | getCallingConv () const |
| getCallingConv/setCallingConv - Get or set the calling convention of this function call. More... | |
| void | setCallingConv (CallingConv::ID CC) |
| const AttributeSet & | getAttributes () const |
| getAttributes - Return the parameter attributes for this call. More... | |
| void | setAttributes (const AttributeSet &Attrs) |
| setAttributes - Set the parameter attributes for this call. More... | |
| void | addAttribute (unsigned i, Attribute::AttrKind attr) |
| addAttribute - adds the attribute to the list of attributes. More... | |
| void | addAttribute (unsigned i, StringRef Kind, StringRef Value) |
| addAttribute - adds the attribute to the list of attributes. More... | |
| void | removeAttribute (unsigned i, Attribute attr) |
| removeAttribute - 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 A) const |
| Determine whether this call has the given attribute. More... | |
| bool | hasFnAttr (StringRef A) const |
| Determine whether this call has the given attribute. More... | |
| bool | paramHasAttr (unsigned i, Attribute::AttrKind A) const |
| Determine whether the call or the callee has the given attributes. 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 | 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 | 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 | 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... | |
| Function * | getCalledFunction () const |
| getCalledFunction - Return the function called, or null if this is an indirect function invocation. More... | |
| const Value * | getCalledValue () const |
| getCalledValue - Get a pointer to the function that is invoked by this instruction. More... | |
| Value * | getCalledValue () |
| void | setCalledFunction (Value *Fn) |
| setCalledFunction - Set the function called. More... | |
| void | setCalledFunction (FunctionType *FTy, Value *Fn) |
| bool | isInlineAsm () const |
| isInlineAsm - Check if this call is an inline asm statement. More... | |
Public Member Functions inherited from llvm::Instruction | |
| ~Instruction () override | |
| Instruction * | user_back () |
| user_back - Specialize the methods defined in Value, as we know that an instruction can only be used by other instructions. More... | |
| const Instruction * | user_back () const |
| const BasicBlock * | getParent () const |
| BasicBlock * | getParent () |
| const Module * | getModule () const |
| Return the module owning the function this instruction belongs to or nullptr it the function does not have a module. More... | |
| Module * | getModule () |
| void | removeFromParent () |
| removeFromParent - This method unlinks 'this' from the containing basic block, but does not delete it. More... | |
| iplist< Instruction >::iterator | eraseFromParent () |
| 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) |
| moveBefore - Unlink this instruction from its current basic block and insert it into the basic block that MovePos lives in, right before MovePos. More... | |
| unsigned | getOpcode () const |
| getOpcode() 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 | isLogicalShift () const |
| isLogicalShift - Return true if this is a logical shift left or a logical shift right. More... | |
| bool | isArithmeticShift () const |
| isArithmeticShift - Return true if this is an arithmetic shift right. More... | |
| bool | hasMetadata () const |
| hasMetadata() - Return true if this instruction has any metadata attached to it. More... | |
| bool | hasMetadataOtherThanDebugLoc () const |
| hasMetadataOtherThanDebugLoc - Return true if this instruction has metadata attached to it other than a debug location. More... | |
| MDNode * | getMetadata (unsigned KindID) const |
| getMetadata - Get the metadata of given kind attached to this Instruction. More... | |
| MDNode * | getMetadata (StringRef Kind) const |
| getMetadata - Get the metadata of given kind attached to this Instruction. More... | |
| void | getAllMetadata (SmallVectorImpl< std::pair< unsigned, MDNode * >> &MDs) const |
| getAllMetadata - Get all metadata attached to this Instruction. More... | |
| void | getAllMetadataOtherThanDebugLoc (SmallVectorImpl< std::pair< unsigned, MDNode * >> &MDs) const |
| getAllMetadataOtherThanDebugLoc - This does the same thing as getAllMetadata, except that it filters out the debug location. More... | |
| void | getAAMetadata (AAMDNodes &N, bool Merge=false) const |
| getAAMetadata - Fills the AAMDNodes structure with AA metadata from this instruction. More... | |
| void | setMetadata (unsigned KindID, MDNode *Node) |
| setMetadata - Set the metadata of the specified kind to the specified node. More... | |
| void | setMetadata (StringRef Kind, MDNode *Node) |
| void | dropUnknownMetadata (ArrayRef< unsigned > KnownIDs) |
| Drop unknown metadata. More... | |
| void | dropUnknownMetadata () |
| void | dropUnknownMetadata (unsigned ID1) |
| void | dropUnknownMetadata (unsigned ID1, unsigned ID2) |
| void | setAAMetadata (const AAMDNodes &N) |
| setAAMetadata - Sets the metadata on this instruction from the AAMDNodes structure. More... | |
| void | setDebugLoc (DebugLoc Loc) |
| setDebugLoc - Set the debug location information for this instruction. More... | |
| const DebugLoc & | getDebugLoc () const |
| getDebugLoc - Return the debug location for this node as a DebugLoc. 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... | |
| bool | isAssociative () const |
| isAssociative - Return true if the instruction is associative: More... | |
| bool | isCommutative () const |
| isCommutative - Return true if the instruction is commutative: More... | |
| bool | isIdempotent () const |
| isIdempotent - Return true if the instruction is idempotent: More... | |
| bool | isNilpotent () const |
| isNilpotent - Return true if the instruction is nilpotent: More... | |
| bool | mayWriteToMemory () const |
| mayWriteToMemory - Return true if this instruction may modify memory. More... | |
| bool | mayReadFromMemory () const |
| mayReadFromMemory - Return true if this instruction may read memory. More... | |
| bool | mayReadOrWriteMemory () const |
| mayReadOrWriteMemory - Return true if this instruction may read or write memory. More... | |
| bool | isAtomic () const |
| isAtomic - Return true if this instruction has an AtomicOrdering of unordered or higher. More... | |
| bool | mayThrow () const |
| mayThrow - Return true if this instruction may throw an exception. More... | |
| bool | mayReturn () const |
| mayReturn - Return true if this is a function that may return. More... | |
| bool | mayHaveSideEffects () const |
| mayHaveSideEffects - Return true if the instruction may have side effects. More... | |
| Instruction * | clone () const |
| clone() - Create a copy of 'this' instruction that is identical in all ways except the following: More... | |
| bool | isIdenticalTo (const Instruction *I) const |
| isIdenticalTo - Return true if the specified instruction is exactly identical to the current one. More... | |
| bool | isIdenticalToWhenDefined (const Instruction *I) const |
| isIdenticalToWhenDefined - This is like isIdenticalTo, except that it ignores the SubclassOptionalData flags, which 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 |
| isUsedOutsideOfBlock - Return true if there are any uses of this instruction in blocks other than the specified block. More... | |
Public Member Functions inherited from llvm::User | |
| ~User () override | |
| 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... | |
| Use * | getOperandList () |
| const Use * | getOperandList () const |
| Value * | getOperand (unsigned i) const |
| void | setOperand (unsigned i, Value *Val) |
| const Use & | getOperandUse (unsigned i) const |
| Use & | getOperandUse (unsigned i) |
| unsigned | getNumOperands () const |
| void | setGlobalVariableNumOperands (unsigned NumOps) |
| Set the number of operands on a GlobalVariable. More... | |
| void | setFunctionNumOperands (unsigned NumOps) |
| Set the number of operands on a Function. 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_iterator > | operand_values () |
| 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 | |
| virtual | ~Value () |
| void | dump () const |
| Support for debugging, callable in GDB: V->dump() More... | |
| Type * | getType () const |
| All values are typed, get the type of this value. More... | |
| LLVMContext & | getContext () const |
| All values hold a context through their type. More... | |
| bool | hasName () const |
| ValueName * | getValueName () 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 | 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... | |
| bool | use_empty () const |
| use_iterator | use_begin () |
| const_use_iterator | use_begin () const |
| use_iterator | use_end () |
| const_use_iterator | use_end () const |
| iterator_range< use_iterator > | uses () |
| iterator_range < const_use_iterator > | uses () const |
| bool | user_empty () const |
| user_iterator | user_begin () |
| const_user_iterator | user_begin () const |
| user_iterator | user_end () |
| const_user_iterator | user_end () const |
| User * | user_back () |
| const User * | user_back () const |
| iterator_range< user_iterator > | users () |
| 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... | |
| void | intersectOptionalDataWith (const Value *V) |
| Clear any optional flags not set in the given Value. 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... | |
| Value * | stripPointerCasts () |
| Strip off pointer casts, all-zero GEPs, and aliases. More... | |
| const Value * | stripPointerCasts () const |
| Value * | stripPointerCastsNoFollowAliases () |
| Strip off pointer casts and all-zero GEPs. More... | |
| const Value * | stripPointerCastsNoFollowAliases () const |
| Value * | stripInBoundsConstantOffsets () |
| Strip off pointer casts and all-constant inbounds GEPs. More... | |
| const Value * | stripInBoundsConstantOffsets () const |
| Value * | stripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) |
| Accumulate offsets from stripInBoundsConstantOffsets(). More... | |
| const Value * | stripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) const |
| Value * | stripInBoundsOffsets () |
| Strip off pointer casts and inbounds GEPs. More... | |
| const Value * | stripInBoundsOffsets () const |
| Value * | DoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) |
| Translate PHI node to its predecessor from the given basic block. More... | |
| const Value * | DoPHITranslation (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) const |
| Implement operator<< on Value. More... | |
| void | print (raw_ostream &O, ModuleSlotTracker &MST) 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< Instruction > | |
| Instruction * | getPrevNode () |
| Get the previous node, or 0 for the list head. More... | |
| const Instruction * | getPrevNode () const |
| Get the previous node, or 0 for the list head. More... | |
| Instruction * | getNextNode () |
| Get the next node, or 0 for the list tail. More... | |
| const Instruction * | getNextNode () const |
| Get the next node, or 0 for the list tail. More... | |
Static Public Member Functions | |
| static CallInst * | Create (Value *Func, ArrayRef< Value * > Args, const Twine &NameStr="", Instruction *InsertBefore=nullptr) |
| static CallInst * | Create (FunctionType *Ty, Value *Func, ArrayRef< Value * > Args, const Twine &NameStr="", Instruction *InsertBefore=nullptr) |
| static CallInst * | Create (Value *Func, ArrayRef< Value * > Args, const Twine &NameStr, BasicBlock *InsertAtEnd) |
| static CallInst * | Create (Value *F, const Twine &NameStr="", Instruction *InsertBefore=nullptr) |
| static CallInst * | Create (Value *F, const Twine &NameStr, BasicBlock *InsertAtEnd) |
| static Instruction * | CreateMalloc (Instruction *InsertBefore, 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 Instruction * | CreateMalloc (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 Instruction * | CreateFree (Value *Source, Instruction *InsertBefore) |
| CreateFree - Generate the IR for a call to the builtin free function. More... | |
| static Instruction * | CreateFree (Value *Source, BasicBlock *InsertAtEnd) |
| CreateFree - Generate the IR for a call to the builtin free function. 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 | 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 | isAssociative (unsigned op) |
| isAssociative - Return true if the instruction is associative: More... | |
| static bool | isCommutative (unsigned op) |
| isCommutative - Return true if the instruction is commutative: More... | |
| static bool | isIdempotent (unsigned op) |
| isIdempotent - Return true if the instruction is idempotent: More... | |
| static bool | isNilpotent (unsigned op) |
| isNilpotent - 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 | |
| CallInst * | cloneImpl () 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... | |
| User (Type *ty, unsigned vty, Use *OpList, 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> | |
| Use & | Op () |
| template<int Idx> | |
| const Use & | Op () 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< Instruction > | |
| ilist_node () | |
Friends | |
| 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 = 29 } |
| The number of operands in the subclass. More... | |
Static Protected Member Functions inherited from llvm::User | |
| template<int Idx, typename U > | |
| static Use & | OpFrom (const U *that) |
Protected Attributes inherited from llvm::Value | |
| unsigned char | SubclassOptionalData: 7 |
| Hold subclass data that can be dropped. More... | |
| unsigned | NumUserOperands: NumUserOperandsBits |
| bool | IsUsedByMD: 1 |
| bool | HasName: 1 |
| bool | HasHungOffUses: 1 |
CallInst - 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.
| Enumerator | |
|---|---|
| TCK_None | |
| TCK_Tail | |
| TCK_MustTail | |
Definition at line 1448 of file Instructions.h.
|
override |
Definition at line 222 of file Instructions.cpp.
| void CallInst::addAttribute | ( | unsigned | i, |
| Attribute::AttrKind | attr | ||
| ) |
addAttribute - adds the attribute to the list of attributes.
Definition at line 289 of file Instructions.cpp.
References llvm::AttributeSet::addAttribute(), getAttributes(), llvm::Value::getContext(), and setAttributes().
Referenced by setCannotDuplicate(), setCanReturnTwice(), setDoesNotAccessMemory(), setDoesNotReturn(), setDoesNotThrow(), setIsNoInline(), setOnlyAccessesArgMemory(), and setOnlyReadsMemory().
addAttribute - adds the attribute to the list of attributes.
Definition at line 295 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 310 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 316 of file Instructions.cpp.
References llvm::AttributeSet::addDereferenceableOrNullAttr(), getAttributes(), llvm::Value::getContext(), and setAttributes().
|
inline |
arg_operands - iteration adapter for range-for loops.
Definition at line 1480 of file Instructions.h.
References llvm::User::op_begin(), and llvm::User::op_end().
Referenced by getVectorCallCost(), and llvm::InstCombiner::visitCallInst().
|
inline |
arg_operands - iteration adapter for range-for loops.
Definition at line 1487 of file Instructions.h.
References llvm::User::op_begin(), and llvm::User::op_end().
|
inline |
Determine if the call cannot be duplicated.
Definition at line 1620 of file Instructions.h.
References hasFnAttr(), and llvm::Attribute::NoDuplicate.
Referenced by HasNoDuplicateCall().
|
inline |
Return true if the call can return twice.
Definition at line 1575 of file Instructions.h.
References hasFnAttr(), and llvm::Attribute::ReturnsTwice.
|
inlinestatic |
Definition at line 1668 of file Instructions.h.
References llvm::Call, and llvm::Instruction::getOpcode().
Referenced by classof().
Definition at line 1671 of file Instructions.h.
References classof().
|
protected |
Definition at line 3571 of file Instructions.cpp.
References llvm::User::getNumOperands().
|
inlinestatic |
Definition at line 1390 of file Instructions.h.
References llvm::Value::getType().
Referenced by changeToCall(), changeToUnreachable(), CombineUAddWithOverflow(), llvm::IRBuilder< true, TargetFolder >::CreateCall(), createCallHelper(), createFree(), createMalloc(), fixupFPReturnAndCall(), llvm::DIBuilder::insertDbgValueIntrinsic(), llvm::DIBuilder::insertDeclare(), InsertSafepointPoll(), insertUseHolderAfter(), llvm::IntrinsicLowering::LowerToByteSwap(), and llvm::InstCombiner::visitFPTrunc().
|
inlinestatic |
Definition at line 1398 of file Instructions.h.
References llvm::ArrayRef< T >::size().
|
inlinestatic |
Definition at line 1404 of file Instructions.h.
References llvm::ArrayRef< T >::size().
|
inlinestatic |
Definition at line 1410 of file Instructions.h.
|
inlinestatic |
Definition at line 1414 of file Instructions.h.
|
static |
CreateFree - Generate the IR for a call to the builtin free function.
Definition at line 480 of file Instructions.cpp.
References createFree().
Referenced by LLVMBuildFree(), and PerformHeapAllocSRoA().
|
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 487 of file Instructions.cpp.
References createFree().
|
static |
CreateMalloc - Generate the IR for a call to malloc:
Definition at line 422 of file Instructions.cpp.
References createMalloc().
Referenced by LLVMBuildArrayMalloc(), LLVMBuildMalloc(), PerformHeapAllocSRoA(), and TryToOptimizeStoreOfMallocToGlobal().
|
static |
CreateMalloc - Generate the IR for a call to malloc:
Definition at line 439 of file Instructions.cpp.
References createMalloc().
| llvm::CallInst::DECLARE_TRANSPARENT_OPERAND_ACCESSORS | ( | Value | ) |
Provide fast operand accessors.
|
inline |
Determine if the call does not access memory.
Definition at line 1583 of file Instructions.h.
References hasFnAttr(), and llvm::Attribute::ReadNone.
Referenced by onlyReadsMemory().
|
inline |
Determine if the call cannot return.
Definition at line 1608 of file Instructions.h.
References hasFnAttr(), and llvm::Attribute::NoReturn.
|
inline |
Determine if the call cannot unwind.
Definition at line 1614 of file Instructions.h.
References hasFnAttr(), and llvm::Attribute::NoUnwind.
Referenced by HandleCallsInBlockInlinedThroughInvoke(), and llvm::InstCombiner::visitCallInst().
getArgOperand/setArgOperand - Return/set the i-th call argument.
Definition at line 1476 of file Instructions.h.
References llvm::User::getOperand().
Referenced by llvm::checkBinaryFloatSignature(), llvm::checkUnaryFloatSignature(), computeArraySize(), computeKnownBitsFromAssume(), llvm::ComputeUsesVAFloatArgument(), detectLog2OfHalf(), llvm::DbgDeclareInst::getAddress(), llvm::MemIntrinsic::getAlignmentCst(), llvm::MemIntrinsic::getAlignmentType(), llvm::VAStartInst::getArgList(), llvm::VAEndInst::getArgList(), llvm::VACopyInst::getDest(), llvm::InstrProfIncrementInst::getHash(), llvm::InstrProfIncrementInst::getIndex(), llvm::MemIntrinsic::getLength(), getLocForWrite(), llvm::InstrProfIncrementInst::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(), llvm::VACopyInst::getSrc(), llvm::AArch64TTIImpl::getTgtMemIntrinsic(), llvm::AArch64TargetLowering::getTgtMemIntrinsic(), llvm::ARMTargetLowering::getTgtMemIntrinsic(), llvm::NVPTXTargetLowering::getTgtMemIntrinsic(), llvm::PPCTargetLowering::getTgtMemIntrinsic(), llvm::DbgValueInst::getValue(), llvm::MemSetInst::getValue(), getVectorIntrinsicCost(), llvm::MemIntrinsic::getVolatileCst(), handleBranchExpect(), handleSwitchExpect(), isDynamicConstant(), isReportingError(), lowerExpectIntrinsic(), llvm::IntrinsicLowering::LowerIntrinsicCall(), llvm::IntrinsicLowering::LowerToByteSwap(), llvm::parseEHActions(), PerformHeapAllocSRoA(), ReplaceFPIntrinsicWithCall(), ScalarizeMaskedLoad(), ScalarizeMaskedStore(), llvm::FastISel::selectIntrinsicCall(), llvm::FastISel::selectPatchpoint(), SimplifyX86insertps(), SimplifyX86vperm2(), tryToMoveFreeBeforeNullTest(), TryToOptimizeStoreOfMallocToGlobal(), llvm::UpgradeIntrinsicCall(), llvm::InstCombiner::visitCallInst(), llvm::InstCombiner::visitFCmpInst(), llvm::InstCombiner::visitFPTrunc(), llvm::InstCombiner::visitFree(), and WriteInstruction().
Wrappers for getting the Use of a call argument.
Definition at line 1492 of file Instructions.h.
References llvm::User::getOperandUse().
Referenced by llvm::MemIntrinsic::getLengthUse(), llvm::MemIntrinsic::getRawDestUse(), llvm::MemTransferInst::getRawSourceUse(), and llvm::MemSetInst::getValueUse().
Definition at line 1493 of file Instructions.h.
References llvm::User::getOperandUse().
|
inline |
getAttributes - Return the parameter attributes for this call.
Definition at line 1507 of file Instructions.h.
Referenced by addAttribute(), addDereferenceableAttr(), addDereferenceableOrNullAttr(), HandleCallsInBlockInlinedThroughInvoke(), makeStatepointExplicitImpl(), removeAttribute(), and WriteInstruction().
|
inline |
getCalledFunction - Return the function called, or null if this is an indirect function invocation.
Definition at line 1640 of file Instructions.h.
References llvm::dyn_cast(), and llvm::User::Op().
Referenced by llvm::IntrinsicInst::classof(), computeKnownBitsFromAssume(), llvm::objcarc::GetARCInstKind(), llvm::IntrinsicInst::getIntrinsicID(), llvm::getIntrinsicIDForCall(), llvm::ARMTargetLowering::getTgtMemIntrinsic(), getVectorCallCost(), handleBranchExpect(), handleSwitchExpect(), llvm::isFreeCall(), isTrigLibCall(), lowerExpectIntrinsic(), llvm::IntrinsicLowering::LowerIntrinsicCall(), llvm::FortifiedLibCallSimplifier::optimizeCall(), llvm::LibCallSimplifier::optimizeCall(), paramHasAttr(), llvm::FastISel::selectStackmap(), llvm::UpgradeIntrinsicCall(), and llvm::InstCombiner::visitFCmpInst().
getCalledValue - Get a pointer to the function that is invoked by this instruction.
Definition at line 1646 of file Instructions.h.
References llvm::User::Op().
Referenced by llvm::ComputeUsesVAFloatArgument(), llvm::ARMTargetLowering::ExpandInlineAsm(), llvm::X86TargetLowering::ExpandInlineAsm(), HandleCallsInBlockInlinedThroughInvoke(), llvm::FastISel::lowerCall(), llvm::FastISel::selectCall(), shouldConvertUse(), llvm::InstCombiner::visitCallInst(), and WriteInstruction().
|
inline |
Definition at line 1647 of file Instructions.h.
References llvm::User::Op().
|
inline |
getCallingConv/setCallingConv - Get or set the calling convention of this function call.
Definition at line 1497 of file Instructions.h.
References llvm::Instruction::getSubclassDataFromInstruction().
Referenced by HandleCallsInBlockInlinedThroughInvoke(), makeStatepointExplicitImpl(), llvm::FortifiedLibCallSimplifier::optimizeCall(), llvm::LibCallSimplifier::optimizeCall(), ReplaceWithStatepoint(), llvm::FastISel::selectPatchpoint(), llvm::FastISel::selectStackmap(), and WriteInstruction().
|
inline |
Extract the number of dereferenceable bytes for a call or parameter (0=unknown).
Definition at line 1551 of file Instructions.h.
References llvm::AttributeSet::getDereferenceableBytes().
|
inline |
Extract the number of dereferenceable_or_null bytes for a call or parameter (0=unknown).
Definition at line 1557 of file Instructions.h.
References llvm::AttributeSet::getDereferenceableOrNullBytes().
|
inline |
Definition at line 1440 of file Instructions.h.
Referenced by WriteInstruction().
|
inline |
getNumArgOperands - Return the number of call arguments.
Definition at line 1472 of file Instructions.h.
References llvm::User::getNumOperands().
Referenced by llvm::checkBinaryFloatSignature(), llvm::checkUnaryFloatSignature(), llvm::ComputeUsesVAFloatArgument(), llvm::AArch64TTIImpl::getOrCreateResultFromMemIntrinsic(), llvm::AArch64TTIImpl::getTgtMemIntrinsic(), llvm::AArch64TargetLowering::getTgtMemIntrinsic(), llvm::ARMTargetLowering::getTgtMemIntrinsic(), getVectorIntrinsicCost(), isReportingError(), llvm::IntrinsicLowering::LowerToByteSwap(), llvm::parseEHActions(), llvm::FastISel::selectPatchpoint(), llvm::UpgradeIntrinsicCall(), and WriteInstruction().
Extract the alignment for a call or parameter (0=unknown).
Definition at line 1545 of file Instructions.h.
References llvm::AttributeSet::getParamAlignment().
|
inline |
Definition at line 1449 of file Instructions.h.
References llvm::Instruction::getSubclassDataFromInstruction().
Referenced by llvm::InlineFunction().
|
inline |
Determine if any call argument is an aggregate passed by value.
Definition at line 1633 of file Instructions.h.
References llvm::Attribute::ByVal, and llvm::AttributeSet::hasAttrSomewhere().
|
inline |
Determine whether this call has the given attribute.
Definition at line 1530 of file Instructions.h.
References llvm::Attribute::NoBuiltin.
Referenced by cannotDuplicate(), canReturnTwice(), doesNotAccessMemory(), doesNotReturn(), doesNotThrow(), isNoInline(), isTrigLibCall(), onlyAccessesArgMemory(), and onlyReadsMemory().
Determine whether this call has the given attribute.
Definition at line 1537 of file Instructions.h.
|
inline |
Determine if the call returns a structure through first pointer argument.
Definition at line 1627 of file Instructions.h.
References paramHasAttr(), and llvm::Attribute::StructRet.
|
inline |
isInlineAsm - Check if this call is an inline asm statement.
Definition at line 1663 of file Instructions.h.
References llvm::User::Op().
Referenced by needsStatepoint().
|
inline |
Definition at line 1455 of file Instructions.h.
References llvm::Instruction::getSubclassDataFromInstruction(), and TCK_MustTail.
Referenced by llvm::InlineFunction(), and WriteInstruction().
|
inline |
Return true if the call should not be treated as a call to a builtin.
Definition at line 1563 of file Instructions.h.
References llvm::Attribute::Builtin, and llvm::Attribute::NoBuiltin.
Referenced by getVectorCallCost(), and llvm::LibCallSimplifier::optimizeCall().
|
inline |
Return true if the call should not be inlined.
Definition at line 1569 of file Instructions.h.
References hasFnAttr(), and llvm::Attribute::NoInline.
|
inline |
Definition at line 1452 of file Instructions.h.
References llvm::Instruction::getSubclassDataFromInstruction(), and TCK_None.
Referenced by llvm::FastISel::lowerCall(), makeStatepointExplicitImpl(), llvm::HexagonTargetLowering::mayBeEmittedAsTailCall(), llvm::SystemZTargetLowering::mayBeEmittedAsTailCall(), ReplaceWithStatepoint(), and WriteInstruction().
|
inline |
Definition at line 1442 of file Instructions.h.
References llvm::FunctionType::getReturnType(), and llvm::Value::mutateType().
|
inline |
Determine if the call can access memmory only using pointers based on its arguments.
Definition at line 1600 of file Instructions.h.
References llvm::Attribute::ArgMemOnly, and hasFnAttr().
|
inline |
Determine if the call does not access or only reads memory.
Definition at line 1591 of file Instructions.h.
References doesNotAccessMemory(), hasFnAttr(), and llvm::Attribute::ReadOnly.
Referenced by llvm::checkBinaryFloatSignature(), and llvm::checkUnaryFloatSignature().
| bool CallInst::paramHasAttr | ( | unsigned | i, |
| Attribute::AttrKind | A | ||
| ) | const |
Determine whether the call or the callee has the given attributes.
Definition at line 322 of file Instructions.cpp.
References F(), getCalledFunction(), and llvm::AttributeSet::hasAttribute().
Referenced by hasStructRetAttr().
removeAttribute - removes the attribute from the list of attributes.
Definition at line 301 of file Instructions.cpp.
References getAttributes(), llvm::Value::getContext(), llvm::AttributeSet::removeAttributes(), and setAttributes().
Definition at line 1477 of file Instructions.h.
References llvm::User::setOperand().
Referenced by llvm::MemIntrinsic::setAlignment(), llvm::MemIntrinsic::setDest(), llvm::MemIntrinsic::setLength(), llvm::MemTransferInst::setSource(), llvm::MemSetInst::setValue(), llvm::MemIntrinsic::setVolatile(), llvm::InstCombiner::visitCallInst(), and llvm::InstCombiner::visitFMul().
|
inline |
setAttributes - Set the parameter attributes for this call.
Definition at line 1511 of file Instructions.h.
Referenced by addAttribute(), addDereferenceableAttr(), addDereferenceableOrNullAttr(), llvm::EmitBinaryFloatFnCall(), llvm::EmitUnaryFloatFnCall(), llvm::orc::makeStub(), removeAttribute(), and ReplaceWithStatepoint().
|
inline |
setCalledFunction - Set the function called.
Definition at line 1650 of file Instructions.h.
References llvm::Value::getType().
Referenced by llvm::InstCombiner::visitCallInst().
|
inline |
Definition at line 1655 of file Instructions.h.
References llvm::Value::getType(), and llvm::User::Op().
|
inline |
Definition at line 1500 of file Instructions.h.
References llvm::Instruction::getSubclassDataFromInstruction().
Referenced by createFree(), createMalloc(), llvm::EmitBinaryFloatFnCall(), llvm::EmitFPutC(), llvm::EmitFPutS(), llvm::EmitFWrite(), llvm::EmitMemChr(), llvm::EmitMemCmp(), llvm::EmitMemCpyChk(), llvm::EmitPutChar(), llvm::EmitPutS(), llvm::EmitStrChr(), llvm::EmitStrCpy(), llvm::EmitStrLen(), llvm::EmitStrNCmp(), llvm::EmitStrNCpy(), llvm::EmitStrNLen(), and llvm::EmitUnaryFloatFnCall().
|
inline |
Definition at line 1621 of file Instructions.h.
References addAttribute(), llvm::AttributeSet::FunctionIndex, and llvm::Attribute::NoDuplicate.
|
inline |
Definition at line 1578 of file Instructions.h.
References addAttribute(), llvm::AttributeSet::FunctionIndex, and llvm::Attribute::ReturnsTwice.
|
inline |
Definition at line 1586 of file Instructions.h.
References addAttribute(), llvm::AttributeSet::FunctionIndex, and llvm::Attribute::ReadNone.
|
inline |
Definition at line 1609 of file Instructions.h.
References addAttribute(), llvm::AttributeSet::FunctionIndex, and llvm::Attribute::NoReturn.
Referenced by INITIALIZE_PASS().
|
inline |
Definition at line 1615 of file Instructions.h.
References addAttribute(), llvm::AttributeSet::FunctionIndex, and llvm::Attribute::NoUnwind.
Referenced by llvm::InlineFunction(), and llvm::InstCombiner::visitCallInst().
|
inline |
Definition at line 1570 of file Instructions.h.
References addAttribute(), llvm::AttributeSet::FunctionIndex, and llvm::Attribute::NoInline.
|
inline |
Definition at line 1603 of file Instructions.h.
References addAttribute(), llvm::Attribute::ArgMemOnly, and llvm::AttributeSet::FunctionIndex.
|
inline |
Definition at line 1594 of file Instructions.h.
References addAttribute(), llvm::AttributeSet::FunctionIndex, and llvm::Attribute::ReadOnly.
Definition at line 1458 of file Instructions.h.
References llvm::Instruction::getSubclassDataFromInstruction(), TCK_None, and TCK_Tail.
Referenced by createFree(), createMalloc(), makeStatepointExplicitImpl(), and llvm::orc::makeStub().
|
inline |
Definition at line 1462 of file Instructions.h.
References llvm::Instruction::getSubclassDataFromInstruction().
Referenced by llvm::InlineFunction().
|
friend |
Definition at line 1386 of file Instructions.h.
1.8.6