class GetElementPtrInst
Declaration
class GetElementPtrInst : public Instruction { /* full declaration omitted */ };
Declared at: llvm/include/llvm/IR/Instructions.h:892
Inherits from: Instruction
Member Variables
Inherited from Value:
- protected SubclassOptionalData
- protected NumUserOperands
- protected IsUsedByMD
- protected HasName
- protected HasHungOffUses
- protected HasDescriptor
- public static MaxAlignmentExponent = 29
- public static MaximumAlignment = 1U << MaxAlignmentExponent
Method Overview
- public static llvm::GetElementPtrInst * Create(llvm::Type * PointeeType, llvm::Value * Ptr, ArrayRef<llvm::Value *> IdxList, const llvm::Twine & NameStr = "", llvm::Instruction * InsertBefore = nullptr)
- public static llvm::GetElementPtrInst * Create(llvm::Type * PointeeType, llvm::Value * Ptr, ArrayRef<llvm::Value *> IdxList, const llvm::Twine & NameStr, llvm::BasicBlock * InsertAtEnd)
- public static llvm::GetElementPtrInst * CreateInBounds(llvm::Value * Ptr, ArrayRef<llvm::Value *> IdxList, const llvm::Twine & NameStr = "", llvm::Instruction * InsertBefore = nullptr)
- public static llvm::GetElementPtrInst * CreateInBounds(llvm::Type * PointeeType, llvm::Value * Ptr, ArrayRef<llvm::Value *> IdxList, const llvm::Twine & NameStr = "", llvm::Instruction * InsertBefore = nullptr)
- public static llvm::GetElementPtrInst * CreateInBounds(llvm::Value * Ptr, ArrayRef<llvm::Value *> IdxList, const llvm::Twine & NameStr, llvm::BasicBlock * InsertAtEnd)
- public static llvm::GetElementPtrInst * CreateInBounds(llvm::Type * PointeeType, llvm::Value * Ptr, ArrayRef<llvm::Value *> IdxList, const llvm::Twine & NameStr, llvm::BasicBlock * InsertAtEnd)
- public bool accumulateConstantOffset(const llvm::DataLayout & DL, llvm::APInt & Offset) const
- public static bool classof(const llvm::Value * V)
- public static bool classof(const llvm::Instruction * I)
- protected llvm::GetElementPtrInst * cloneImpl() const
- public unsigned int getAddressSpace() const
- public static llvm::Type * getGEPReturnType(llvm::Type * ElTy, llvm::Value * Ptr, ArrayRef<llvm::Value *> IdxList)
- public static llvm::Type * getIndexedType(llvm::Type * Ty, ArrayRef<llvm::Value *> IdxList)
- public static llvm::Type * getIndexedType(llvm::Type * Ty, ArrayRef<llvm::Constant *> IdxList)
- public static llvm::Type * getIndexedType(llvm::Type * Ty, ArrayRef<uint64_t> IdxList)
- public unsigned int getNumIndices() const
- public unsigned int getPointerAddressSpace() const
- public const llvm::Value * getPointerOperand() const
- public llvm::Value * getPointerOperand()
- public static unsigned int getPointerOperandIndex()
- public llvm::Type * getPointerOperandType() const
- public llvm::Type * getResultElementType() const
- public llvm::Type * getSourceElementType() const
- public bool hasAllConstantIndices() const
- public bool hasAllZeroIndices() const
- public bool hasIndices() const
- public inline llvm::User::op_iterator idx_begin()
- public inline llvm::User::const_op_iterator idx_begin() const
- public inline llvm::User::op_iterator idx_end()
- public inline llvm::User::const_op_iterator idx_end() const
- public inline iterator_range<llvm::User::op_iterator> indices()
- public inline iterator_range<llvm::User::const_op_iterator> indices() const
- public bool isInBounds() const
- public void setIsInBounds(bool b = true)
- public void setResultElementType(llvm::Type * Ty)
- public void setSourceElementType(llvm::Type * Ty)
Inherited from Instruction:
- public andIRFlags
- public applyMergedLocation
- public classof
- public clone
- public copyFastMathFlags
- public copyFastMathFlags
- public copyIRFlags
- public copyMetadata
- public dropPoisonGeneratingFlags
- public dropUnknownNonDebugMetadata
- public dropUnknownNonDebugMetadata
- public dropUnknownNonDebugMetadata
- public dropUnknownNonDebugMetadata
- public eraseFromParent
- public extractProfMetadata
- public extractProfTotalWeight
- public getAAMetadata
- public getAllMetadata
- public getAllMetadataOtherThanDebugLoc
- public getDebugLoc
- public getFastMathFlags
- public getFunction
- public getFunction
- public getMetadata
- public getMetadata
- public getModule
- public getModule
- public getNextNonDebugInstruction
- public getNextNonDebugInstruction
- public getNumSuccessors
- public getOpcode
- public getOpcodeName
- public getOpcodeName
- public getParent
- public getParent
- public getPrevNonDebugInstruction
- public getPrevNonDebugInstruction
- protected getSubclassDataFromInstruction
- public getSuccessor
- public hasAllowContract
- public hasAllowReassoc
- public hasAllowReciprocal
- public hasApproxFunc
- public hasAtomicLoad
- public hasAtomicStore
- public hasMetadata
- public hasMetadata
- public hasMetadata
- public hasMetadataOtherThanDebugLoc
- public hasNoInfs
- public hasNoNaNs
- public hasNoSignedWrap
- public hasNoSignedZeros
- public hasNoUnsignedWrap
- public insertAfter
- public insertBefore
- public isArithmeticShift
- public isAssociative
- public isAssociative
- public isAtomic
- public isBinaryOp
- public isBinaryOp
- public isBitwiseLogicOp
- public isBitwiseLogicOp
- public isCast
- public isCast
- public isCommutative
- public isCommutative
- public isEHPad
- public isExact
- public isExceptionalTerminator
- public isExceptionalTerminator
- public isFast
- public isFenceLike
- public isFuncletPad
- public isFuncletPad
- public isIdempotent
- public isIdempotent
- public isIdenticalTo
- public isIdenticalToWhenDefined
- public isIndirectTerminator
- public isIndirectTerminator
- public isIntDivRem
- public isIntDivRem
- public isLifetimeStartOrEnd
- public isLogicalShift
- public isNilpotent
- public isNilpotent
- public isSafeToRemove
- public isSameOperationAs
- public isShift
- public isShift
- public isTerminator
- public isTerminator
- public isUnaryOp
- public isUnaryOp
- public isUsedOutsideOfBlock
- public mayHaveSideEffects
- public mayReadFromMemory
- public mayReadOrWriteMemory
- public mayThrow
- public mayWriteToMemory
- public moveAfter
- public moveBefore
- public moveBefore
- public removeFromParent
- public replaceSuccessorWith
- public setAAMetadata
- public setDebugLoc
- public setFast
- public setFastMathFlags
- public setHasAllowReassoc
- public setHasAllowReciprocal
- public setHasApproxFunc
- public setHasNoInfs
- public setHasNoNaNs
- public setHasNoSignedWrap
- public setHasNoSignedZeros
- public setHasNoUnsignedWrap
- protected setInstructionSubclassData
- public setIsExact
- public setMetadata
- public setMetadata
- public setProfWeight
- public setSuccessor
- public swapProfMetadata
- public user_back
- public user_back
Inherited from User:
- protected Op
- protected Op
- protected OpFrom
- protected allocHungoffUses
- public classof
- public dropAllReferences
- public getDescriptor
- public getDescriptor
- public getNumOperands
- public getOperand
- public getOperandList
- public getOperandList
- public getOperandUse
- public getOperandUse
- protected growHungoffUses
- public op_begin
- public op_begin
- public op_end
- public op_end
- public operand_values
- public operand_values
- public operands
- public operands
- public replaceUsesOfWith
- public setGlobalVariableNumOperands
- public setNumHungOffUseOperands
- public setOperand
- public value_op_begin
- public value_op_begin
- public value_op_end
- public value_op_end
Inherited from Value:
- public DoPHITranslation
- public DoPHITranslation
- public addUse
- public assertModuleIsMaterialized
- public assertModuleIsMaterializedImpl
- public clearSubclassOptionalData
- public deleteValue
- public dump
- public getContext
- public getName
- public getNumUses
- public getPointerAlignment
- public getPointerDereferenceableBytes
- public getRawSubclassOptionalData
- protected getSubclassDataFromValue
- public getType
- public getValueID
- public getValueName
- public hasNUses
- public hasNUsesOrMore
- public hasName
- public hasOneUse
- public hasSameSubclassOptionalData
- public hasValueHandle
- public isSwiftError
- public isUsedByMetadata
- public isUsedInBasicBlock
- public materialized_use_begin
- public materialized_use_begin
- public materialized_use_empty
- public materialized_user_begin
- public materialized_user_begin
- public materialized_users
- public materialized_users
- public materialized_uses
- public materialized_uses
- public mutateType
- public print
- public print
- public printAsOperand
- public printAsOperand
- public replaceAllUsesWith
- public replaceNonMetadataUsesWith
- public replaceUsesOutsideBlock
- public replaceUsesWithIf
- public reverseUseList
- public setName
- public setValueName
- protected setValueSubclassData
- public sortUseList
- public stripAndAccumulateConstantOffsets
- public stripAndAccumulateConstantOffsets
- public stripAndAccumulateInBoundsConstantOffsets
- public stripAndAccumulateInBoundsConstantOffsets
- public stripInBoundsConstantOffsets
- public stripInBoundsConstantOffsets
- public stripInBoundsOffsets
- public stripInBoundsOffsets
- public stripPointerCasts
- public stripPointerCasts
- public stripPointerCastsAndAliases
- public stripPointerCastsAndAliases
- public stripPointerCastsAndInvariantGroups
- public stripPointerCastsAndInvariantGroups
- public stripPointerCastsSameRepresentation
- public stripPointerCastsSameRepresentation
- public takeName
- public use_begin
- public use_begin
- public use_empty
- public use_end
- public use_end
- public user_back
- public user_back
- public user_begin
- public user_begin
- public user_empty
- public user_end
- public user_end
- public users
- public users
- public uses
- public uses
Methods
¶static llvm::GetElementPtrInst* Create(
llvm::Type* PointeeType,
llvm::Value* Ptr,
ArrayRef<llvm::Value*> IdxList,
const llvm::Twine& NameStr = "",
llvm::Instruction* InsertBefore = nullptr)
static llvm::GetElementPtrInst* Create(
llvm::Type* PointeeType,
llvm::Value* Ptr,
ArrayRef<llvm::Value*> IdxList,
const llvm::Twine& NameStr = "",
llvm::Instruction* InsertBefore = nullptr)
Declared at: llvm/include/llvm/IR/Instructions.h:918
Parameters
- llvm::Type* PointeeType
- llvm::Value* Ptr
- ArrayRef<llvm::Value*> IdxList
- const llvm::Twine& NameStr = ""
- llvm::Instruction* InsertBefore = nullptr
¶static llvm::GetElementPtrInst* Create(
llvm::Type* PointeeType,
llvm::Value* Ptr,
ArrayRef<llvm::Value*> IdxList,
const llvm::Twine& NameStr,
llvm::BasicBlock* InsertAtEnd)
static llvm::GetElementPtrInst* Create(
llvm::Type* PointeeType,
llvm::Value* Ptr,
ArrayRef<llvm::Value*> IdxList,
const llvm::Twine& NameStr,
llvm::BasicBlock* InsertAtEnd)
Declared at: llvm/include/llvm/IR/Instructions.h:934
Parameters
- llvm::Type* PointeeType
- llvm::Value* Ptr
- ArrayRef<llvm::Value*> IdxList
- const llvm::Twine& NameStr
- llvm::BasicBlock* InsertAtEnd
¶static llvm::GetElementPtrInst* CreateInBounds(
llvm::Value* Ptr,
ArrayRef<llvm::Value*> IdxList,
const llvm::Twine& NameStr = "",
llvm::Instruction* InsertBefore = nullptr)
static llvm::GetElementPtrInst* CreateInBounds(
llvm::Value* Ptr,
ArrayRef<llvm::Value*> IdxList,
const llvm::Twine& NameStr = "",
llvm::Instruction* InsertBefore = nullptr)
Description
Create an "inbounds" getelementptr. See the documentation for the "inbounds" flag in LangRef.html for details.
Declared at: llvm/include/llvm/IR/Instructions.h:952
Parameters
- llvm::Value* Ptr
- ArrayRef<llvm::Value*> IdxList
- const llvm::Twine& NameStr = ""
- llvm::Instruction* InsertBefore = nullptr
¶static llvm::GetElementPtrInst* CreateInBounds(
llvm::Type* PointeeType,
llvm::Value* Ptr,
ArrayRef<llvm::Value*> IdxList,
const llvm::Twine& NameStr = "",
llvm::Instruction* InsertBefore = nullptr)
static llvm::GetElementPtrInst* CreateInBounds(
llvm::Type* PointeeType,
llvm::Value* Ptr,
ArrayRef<llvm::Value*> IdxList,
const llvm::Twine& NameStr = "",
llvm::Instruction* InsertBefore = nullptr)
Declared at: llvm/include/llvm/IR/Instructions.h:960
Parameters
- llvm::Type* PointeeType
- llvm::Value* Ptr
- ArrayRef<llvm::Value*> IdxList
- const llvm::Twine& NameStr = ""
- llvm::Instruction* InsertBefore = nullptr
¶static llvm::GetElementPtrInst* CreateInBounds(
llvm::Value* Ptr,
ArrayRef<llvm::Value*> IdxList,
const llvm::Twine& NameStr,
llvm::BasicBlock* InsertAtEnd)
static llvm::GetElementPtrInst* CreateInBounds(
llvm::Value* Ptr,
ArrayRef<llvm::Value*> IdxList,
const llvm::Twine& NameStr,
llvm::BasicBlock* InsertAtEnd)
Declared at: llvm/include/llvm/IR/Instructions.h:969
Parameters
- llvm::Value* Ptr
- ArrayRef<llvm::Value*> IdxList
- const llvm::Twine& NameStr
- llvm::BasicBlock* InsertAtEnd
¶static llvm::GetElementPtrInst* CreateInBounds(
llvm::Type* PointeeType,
llvm::Value* Ptr,
ArrayRef<llvm::Value*> IdxList,
const llvm::Twine& NameStr,
llvm::BasicBlock* InsertAtEnd)
static llvm::GetElementPtrInst* CreateInBounds(
llvm::Type* PointeeType,
llvm::Value* Ptr,
ArrayRef<llvm::Value*> IdxList,
const llvm::Twine& NameStr,
llvm::BasicBlock* InsertAtEnd)
Declared at: llvm/include/llvm/IR/Instructions.h:976
Parameters
- llvm::Type* PointeeType
- llvm::Value* Ptr
- ArrayRef<llvm::Value*> IdxList
- const llvm::Twine& NameStr
- llvm::BasicBlock* InsertAtEnd
¶bool accumulateConstantOffset(
const llvm::DataLayout& DL,
llvm::APInt& Offset) const
bool accumulateConstantOffset(
const llvm::DataLayout& DL,
llvm::APInt& Offset) const
Description
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.
Declared at: llvm/include/llvm/IR/Instructions.h:1104
Parameters
- const llvm::DataLayout& DL
- llvm::APInt& Offset
¶static bool classof(const llvm::Value* V)
static bool classof(const llvm::Value* V)
Declared at: llvm/include/llvm/IR/Instructions.h:1110
Parameters
- const llvm::Value* V
¶static bool classof(const llvm::Instruction* I)
static bool classof(const llvm::Instruction* I)
Declared at: llvm/include/llvm/IR/Instructions.h:1107
Parameters
- const llvm::Instruction* I
¶llvm::GetElementPtrInst* cloneImpl() const
llvm::GetElementPtrInst* cloneImpl() const
Declared at: llvm/include/llvm/IR/Instructions.h:915
¶unsigned int getAddressSpace() const
unsigned int getAddressSpace() const
Description
Returns the address space of this instruction's pointer type.
Declared at: llvm/include/llvm/IR/Instructions.h:1001
¶static llvm::Type* getGEPReturnType(
llvm::Type* ElTy,
llvm::Value* Ptr,
ArrayRef<llvm::Value*> IdxList)
static llvm::Type* getGEPReturnType(
llvm::Type* ElTy,
llvm::Value* Ptr,
ArrayRef<llvm::Value*> IdxList)
Description
Returns the pointer type returned by the GEP instruction, which may be a vector of pointers.
Declared at: llvm/include/llvm/IR/Instructions.h:1053
Parameters
- llvm::Type* ElTy
- llvm::Value* Ptr
- ArrayRef<llvm::Value*> IdxList
¶static llvm::Type* getIndexedType(
llvm::Type* Ty,
ArrayRef<llvm::Value*> IdxList)
static llvm::Type* getIndexedType(
llvm::Type* Ty,
ArrayRef<llvm::Value*> IdxList)
Description
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.
Declared at: llvm/include/llvm/IR/Instructions.h:1013
Parameters
- llvm::Type* Ty
- ArrayRef<llvm::Value*> IdxList
¶static llvm::Type* getIndexedType(
llvm::Type* Ty,
ArrayRef<llvm::Constant*> IdxList)
static llvm::Type* getIndexedType(
llvm::Type* Ty,
ArrayRef<llvm::Constant*> IdxList)
Declared at: llvm/include/llvm/IR/Instructions.h:1014
Parameters
- llvm::Type* Ty
- ArrayRef<llvm::Constant*> IdxList
¶static llvm::Type* getIndexedType(
llvm::Type* Ty,
ArrayRef<uint64_t> IdxList)
static llvm::Type* getIndexedType(
llvm::Type* Ty,
ArrayRef<uint64_t> IdxList)
Declared at: llvm/include/llvm/IR/Instructions.h:1015
Parameters
- llvm::Type* Ty
- ArrayRef<uint64_t> IdxList
¶unsigned int getNumIndices() const
unsigned int getNumIndices() const
Declared at: llvm/include/llvm/IR/Instructions.h:1071
¶unsigned int getPointerAddressSpace() const
unsigned int getPointerAddressSpace() const
Description
Returns the address space of the pointer operand.
Declared at: llvm/include/llvm/IR/Instructions.h:1047
¶const llvm::Value* getPointerOperand() const
const llvm::Value* getPointerOperand() const
Declared at: llvm/include/llvm/IR/Instructions.h:1033
¶llvm::Value* getPointerOperand()
llvm::Value* getPointerOperand()
Declared at: llvm/include/llvm/IR/Instructions.h:1030
¶static unsigned int getPointerOperandIndex()
static unsigned int getPointerOperandIndex()
Declared at: llvm/include/llvm/IR/Instructions.h:1036
¶llvm::Type* getPointerOperandType() const
llvm::Type* getPointerOperandType() const
Description
Method to return the pointer operand as a PointerType.
Declared at: llvm/include/llvm/IR/Instructions.h:1042
¶llvm::Type* getResultElementType() const
llvm::Type* getResultElementType() const
Declared at: llvm/include/llvm/IR/Instructions.h:994
¶llvm::Type* getSourceElementType() const
llvm::Type* getSourceElementType() const
Declared at: llvm/include/llvm/IR/Instructions.h:989
¶bool hasAllConstantIndices() const
bool hasAllConstantIndices() const
Description
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.
Declared at: llvm/include/llvm/IR/Instructions.h:1087
¶bool hasAllZeroIndices() const
bool hasAllZeroIndices() const
Description
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.
Declared at: llvm/include/llvm/IR/Instructions.h:1082
¶bool hasIndices() const
bool hasIndices() const
Declared at: llvm/include/llvm/IR/Instructions.h:1075
¶inline llvm::User::op_iterator idx_begin()
inline llvm::User::op_iterator idx_begin()
Declared at: llvm/include/llvm/IR/Instructions.h:1017
¶inline llvm::User::const_op_iterator idx_begin()
const
inline llvm::User::const_op_iterator idx_begin()
const
Declared at: llvm/include/llvm/IR/Instructions.h:1018
¶inline llvm::User::op_iterator idx_end()
inline llvm::User::op_iterator idx_end()
Declared at: llvm/include/llvm/IR/Instructions.h:1019
¶inline llvm::User::const_op_iterator idx_end()
const
inline llvm::User::const_op_iterator idx_end()
const
Declared at: llvm/include/llvm/IR/Instructions.h:1020
¶inline iterator_range<llvm::User::op_iterator>
indices()
inline iterator_range<llvm::User::op_iterator>
indices()
Declared at: llvm/include/llvm/IR/Instructions.h:1022
¶inline iterator_range<
llvm::User::const_op_iterator>
indices() const
inline iterator_range<
llvm::User::const_op_iterator>
indices() const
Declared at: llvm/include/llvm/IR/Instructions.h:1026
¶bool isInBounds() const
bool isInBounds() const
Description
Determine whether the GEP has the inbounds flag.
Declared at: llvm/include/llvm/IR/Instructions.h:1094
¶void setIsInBounds(bool b = true)
void setIsInBounds(bool b = true)
Description
Set or clear the inbounds flag on this GEP instruction. See LangRef.html for the meaning of inbounds on a getelementptr.
Declared at: llvm/include/llvm/IR/Instructions.h:1091
Parameters
- bool b = true
¶void setResultElementType(llvm::Type* Ty)
void setResultElementType(llvm::Type* Ty)
Declared at: llvm/include/llvm/IR/Instructions.h:992
Parameters
- llvm::Type* Ty
¶void setSourceElementType(llvm::Type* Ty)
void setSourceElementType(llvm::Type* Ty)
Declared at: llvm/include/llvm/IR/Instructions.h:991
Parameters
- llvm::Type* Ty