LLVM API Documentation
#include <Instructions.h>


Public Member Functions | |
| DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Value) | |
| Transparently provide more efficient getOperand methods. | |
| SequentialType * | getType () const |
| unsigned | getAddressSpace () const |
| Returns the address space of this instruction's pointer type. | |
| op_iterator | idx_begin () |
| const_op_iterator | idx_begin () const |
| op_iterator | idx_end () |
| const_op_iterator | idx_end () const |
| Value * | getPointerOperand () |
| const Value * | getPointerOperand () const |
| Type * | getPointerOperandType () const |
| unsigned | getPointerAddressSpace () const |
| Returns the address space of the pointer operand. | |
| unsigned | getNumIndices () const |
| bool | hasIndices () const |
| bool | hasAllZeroIndices () const |
| bool | hasAllConstantIndices () const |
| void | setIsInBounds (bool b=true) |
| bool | isInBounds () const |
| isInBounds - Determine whether the GEP has the inbounds flag. | |
| bool | accumulateConstantOffset (const DataLayout &DL, APInt &Offset) const |
| Accumulate the constant address offset of this GEP if possible. | |
Static Public Member Functions | |
| static GetElementPtrInst * | Create (Value *Ptr, ArrayRef< Value * > IdxList, const Twine &NameStr="", Instruction *InsertBefore=0) |
| static GetElementPtrInst * | Create (Value *Ptr, ArrayRef< Value * > IdxList, const Twine &NameStr, BasicBlock *InsertAtEnd) |
| static GetElementPtrInst * | CreateInBounds (Value *Ptr, ArrayRef< Value * > IdxList, const Twine &NameStr="", Instruction *InsertBefore=0) |
| static GetElementPtrInst * | CreateInBounds (Value *Ptr, ArrayRef< Value * > IdxList, const Twine &NameStr, BasicBlock *InsertAtEnd) |
| static Type * | getIndexedType (Type *Ptr, ArrayRef< Value * > IdxList) |
| static Type * | getIndexedType (Type *Ptr, ArrayRef< Constant * > IdxList) |
| static Type * | getIndexedType (Type *Ptr, ArrayRef< uint64_t > IdxList) |
| static unsigned | getPointerOperandIndex () |
| static Type * | getGEPReturnType (Value *Ptr, ArrayRef< Value * > IdxList) |
| static bool | classof (const Instruction *I) |
| static bool | classof (const Value *V) |
| Methods for support type inquiry through isa, cast, and dyn_cast: | |
Protected Member Functions | |
| virtual GetElementPtrInst * | clone_impl () const |
GetElementPtrInst - an instruction for type-safe pointer arithmetic to access elements of arrays and structs
Definition at line 711 of file Instructions.h.
| bool GetElementPtrInst::accumulateConstantOffset | ( | const DataLayout & | DL, |
| APInt & | Offset | ||
| ) | const |
Accumulate the constant address offset of this GEP if possible.
This routine accepts an APInt into which it will accumulate the constant offset of this GEP if the GEP is in fact constant. If the GEP is not all-constant, it returns false and the value of the offset APInt is undefined (it is *not* preserved!). The APInt passed into this routine must be at least as wide as the IntPtr type for the address space of the base GEP pointer.
Definition at line 1430 of file Instructions.cpp.
Referenced by llvm::detail::PtrUseVisitorBase::adjustOffsetForGEP(), and llvm::InstCombiner::visitGetElementPtrInst().
| static bool llvm::GetElementPtrInst::classof | ( | const Instruction * | I | ) | [inline, static] |
Definition at line 865 of file Instructions.h.
References llvm::Instruction::getOpcode().
Referenced by classof().
Methods for support type inquiry through isa, cast, and dyn_cast:
Reimplemented from llvm::Instruction.
Definition at line 868 of file Instructions.h.
References classof().
| GetElementPtrInst * GetElementPtrInst::clone_impl | ( | ) | const [protected, virtual] |
Implements llvm::Instruction.
Definition at line 3384 of file Instructions.cpp.
References llvm::User::getNumOperands().
| static GetElementPtrInst* llvm::GetElementPtrInst::Create | ( | Value * | Ptr, |
| ArrayRef< Value * > | IdxList, | ||
| const Twine & | NameStr = "", |
||
| Instruction * | InsertBefore = 0 |
||
| ) | [inline, static] |
Definition at line 728 of file Instructions.h.
References llvm::ArrayRef< T >::size().
Referenced by llvm::IRBuilder< true, TargetFolder >::CreateConstGEP1_32(), llvm::IRBuilder< true, TargetFolder >::CreateConstGEP1_64(), llvm::IRBuilder< true, TargetFolder >::CreateConstGEP2_32(), llvm::IRBuilder< true, TargetFolder >::CreateConstGEP2_64(), llvm::IRBuilder< true, TargetFolder >::CreateGEP(), llvm::NoFolder::CreateGetElementPtr(), CreateInBounds(), llvm::ConstantExpr::getAsInstruction(), RewriteHeapSROALoadUser(), SRAGlobal(), and llvm::InstCombiner::visitGetElementPtrInst().
| static GetElementPtrInst* llvm::GetElementPtrInst::Create | ( | Value * | Ptr, |
| ArrayRef< Value * > | IdxList, | ||
| const Twine & | NameStr, | ||
| BasicBlock * | InsertAtEnd | ||
| ) | [inline, static] |
Definition at line 735 of file Instructions.h.
References llvm::ArrayRef< T >::size().
| static GetElementPtrInst* llvm::GetElementPtrInst::CreateInBounds | ( | Value * | Ptr, |
| ArrayRef< Value * > | IdxList, | ||
| const Twine & | NameStr = "", |
||
| Instruction * | InsertBefore = 0 |
||
| ) | [inline, static] |
Create an "inbounds" getelementptr. See the documentation for the "inbounds" flag in LangRef.html for details.
Definition at line 745 of file Instructions.h.
References Create(), and setIsInBounds().
Referenced by llvm::IRBuilder< true, TargetFolder >::CreateConstInBoundsGEP1_32(), llvm::IRBuilder< true, TargetFolder >::CreateConstInBoundsGEP1_64(), llvm::IRBuilder< true, TargetFolder >::CreateConstInBoundsGEP2_32(), llvm::IRBuilder< true, TargetFolder >::CreateConstInBoundsGEP2_64(), llvm::IRBuilder< true, TargetFolder >::CreateInBoundsGEP(), llvm::NoFolder::CreateInBoundsGetElementPtr(), llvm::ConstantExpr::getAsInstruction(), llvm::InstCombiner::visitAllocaInst(), llvm::InstCombiner::visitBitCast(), and llvm::InstCombiner::visitGetElementPtrInst().
| static GetElementPtrInst* llvm::GetElementPtrInst::CreateInBounds | ( | Value * | Ptr, |
| ArrayRef< Value * > | IdxList, | ||
| const Twine & | NameStr, | ||
| BasicBlock * | InsertAtEnd | ||
| ) | [inline, static] |
Definition at line 753 of file Instructions.h.
References Create(), and setIsInBounds().
| llvm::GetElementPtrInst::DECLARE_TRANSPARENT_OPERAND_ACCESSORS | ( | Value | ) |
Transparently provide more efficient getOperand methods.
| unsigned llvm::GetElementPtrInst::getAddressSpace | ( | ) | const [inline] |
Returns the address space of this instruction's pointer type.
Definition at line 771 of file Instructions.h.
References getPointerAddressSpace().
| static Type* llvm::GetElementPtrInst::getGEPReturnType | ( | Value * | Ptr, |
| ArrayRef< Value * > | IdxList | ||
| ) | [inline, static] |
GetGEPReturnType - Returns the pointer type returned by the GEP instruction, which may be a vector of pointers.
Definition at line 815 of file Instructions.h.
References llvm::checkGEPType(), llvm::VectorType::get(), llvm::PointerType::get(), getIndexedType(), llvm::Type::getPointerAddressSpace(), llvm::Value::getType(), and llvm::Type::isVectorTy().
getIndexedType - Returns the type of the element that would be loaded with a load instruction with the specified parameters.
Null is returned if the indices are invalid for the specified pointer type.
Definition at line 1384 of file Instructions.cpp.
References getIndexedTypeInternal().
Referenced by CastGEPIndices(), ConstantFoldGetElementPtrImpl(), getGEPReturnType(), llvm::ConstantExpr::getGetElementPtr(), and SimplifyGEPInst().
Definition at line 1388 of file Instructions.cpp.
References getIndexedTypeInternal().
Definition at line 1393 of file Instructions.cpp.
References getIndexedTypeInternal().
| unsigned llvm::GetElementPtrInst::getNumIndices | ( | ) | const [inline] |
Definition at line 829 of file Instructions.h.
References llvm::User::getNumOperands().
| unsigned llvm::GetElementPtrInst::getPointerAddressSpace | ( | ) | const [inline] |
Returns the address space of the pointer operand.
Definition at line 809 of file Instructions.h.
References llvm::Type::getPointerAddressSpace(), and getPointerOperandType().
Referenced by getAddressSpace(), and llvm::InstCombiner::visitGetElementPtrInst().
| Value* llvm::GetElementPtrInst::getPointerOperand | ( | ) | [inline] |
Definition at line 792 of file Instructions.h.
References llvm::User::getOperand().
Referenced by getPointerOperandType(), and llvm::Interpreter::visitGetElementPtrInst().
| const Value* llvm::GetElementPtrInst::getPointerOperand | ( | ) | const [inline] |
Definition at line 795 of file Instructions.h.
References llvm::User::getOperand().
| static unsigned llvm::GetElementPtrInst::getPointerOperandIndex | ( | ) | [inline, static] |
Definition at line 798 of file Instructions.h.
| Type* llvm::GetElementPtrInst::getPointerOperandType | ( | ) | const [inline] |
getPointerOperandType - Method to return the pointer operand as a PointerType.
Definition at line 804 of file Instructions.h.
References getPointerOperand(), and llvm::Value::getType().
Referenced by getPointerAddressSpace(), and llvm::InstCombiner::visitGetElementPtrInst().
| SequentialType* llvm::GetElementPtrInst::getType | ( | ) | const [inline] |
All values are typed, get the type of this value.
Reimplemented from llvm::Value.
Definition at line 766 of file Instructions.h.
Referenced by llvm::InstCombiner::visitGetElementPtrInst().
| bool GetElementPtrInst::hasAllConstantIndices | ( | ) | const |
hasAllConstantIndices - Return true if all of the indices of this GEP are constant integers. If so, the result pointer and the first operand have a constant offset between them.
Definition at line 1414 of file Instructions.cpp.
References llvm::User::getNumOperands(), and llvm::User::getOperand().
Referenced by isSafeAndProfitableToSinkLoad().
| bool GetElementPtrInst::hasAllZeroIndices | ( | ) | const |
hasAllZeroIndices - Return true if all of the indices of this GEP are zeros. If so, the result pointer and the first operand have the same value, just potentially different types.
Definition at line 1400 of file Instructions.cpp.
References llvm::User::getNumOperands(), and llvm::User::getOperand().
| bool llvm::GetElementPtrInst::hasIndices | ( | ) | const [inline] |
Definition at line 833 of file Instructions.h.
References llvm::User::getNumOperands().
| op_iterator llvm::GetElementPtrInst::idx_begin | ( | ) | [inline] |
Definition at line 787 of file Instructions.h.
References llvm::User::op_begin().
Referenced by llvm::InstCombiner::visitGetElementPtrInst().
| const_op_iterator llvm::GetElementPtrInst::idx_begin | ( | ) | const [inline] |
Definition at line 788 of file Instructions.h.
References llvm::User::op_begin().
| op_iterator llvm::GetElementPtrInst::idx_end | ( | ) | [inline] |
Definition at line 789 of file Instructions.h.
References llvm::User::op_end().
Referenced by llvm::InstCombiner::visitGetElementPtrInst().
| const_op_iterator llvm::GetElementPtrInst::idx_end | ( | ) | const [inline] |
Definition at line 790 of file Instructions.h.
References llvm::User::op_end().
| bool GetElementPtrInst::isInBounds | ( | ) | const |
isInBounds - Determine whether the GEP has the inbounds flag.
Definition at line 1426 of file Instructions.cpp.
Referenced by llvm::InstCombiner::FoldCmpLoadFromIndexedGlobal(), and llvm::InstCombiner::visitGetElementPtrInst().
setIsInBounds - Set or clear the inbounds flag on this GEP instruction. See LangRef.html for the meaning of inbounds on a getelementptr.
Definition at line 1422 of file Instructions.cpp.
Referenced by CreateInBounds().