LLVM API Documentation

Public Member Functions | Static Public Member Functions | Friends
llvm::GEPOperator Class Reference

#include <Operator.h>

Inheritance diagram for llvm::GEPOperator:
Inheritance graph
Collaboration diagram for llvm::GEPOperator:
Collaboration graph

List of all members.

Public Member Functions

bool isInBounds () const
op_iterator idx_begin ()
const_op_iterator idx_begin () const
op_iterator idx_end ()
const_op_iterator idx_end () const
ValuegetPointerOperand ()
const ValuegetPointerOperand () const
TypegetPointerOperandType () const
unsigned getPointerAddressSpace () const
unsigned getNumIndices () const
bool hasIndices () const
bool hasAllZeroIndices () const
bool hasAllConstantIndices () const
bool accumulateConstantOffset (const DataLayout &DL, APInt &Offset) const
 Accumulate the constant address offset of this GEP if possible.

Static Public Member Functions

static unsigned getPointerOperandIndex ()


class GetElementPtrInst
class ConstantExpr

Detailed Description

Definition at line 368 of file Operator.h.

Member Function Documentation

bool llvm::GEPOperator::accumulateConstantOffset ( const DataLayout DL,
APInt Offset 
) const [inline]

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 exactly as wide as the IntPtr type for the address space of the base GEP pointer.

Definition at line 455 of file Operator.h.

References llvm::dyn_cast(), llvm::gep_type_begin(), llvm::gep_type_end(), llvm::APInt::getBitWidth(), llvm::StructLayout::getElementOffset(), llvm::DataLayout::getPointerSizeInBits(), llvm::DataLayout::getStructLayout(), llvm::DataLayout::getTypeAllocSize(), llvm::ConstantInt::getValue(), llvm::ConstantInt::getZExtValue(), llvm::ConstantInt::isZero(), and llvm::APInt::sextOrTrunc().

Referenced by IsConstantOffsetFromGlobal(), and llvm::ObjectSizeOffsetVisitor::visitGEPOperator().

Definition at line 415 of file Operator.h.

References llvm::User::getNumOperands().

getPointerAddressSpace - Method to return the address space of the pointer operand.

Definition at line 411 of file Operator.h.

Referenced by DecomposeGEPExpression(), and isGEPKnownNonNull().

Definition at line 396 of file Operator.h.

References llvm::User::getOperand().

Definition at line 399 of file Operator.h.

getPointerOperandType - Method to return the pointer operand as a PointerType.

Definition at line 405 of file Operator.h.

References getPointerOperand().

Referenced by llvm::DependenceAnalysis::depends(), and llvm::DependenceAnalysis::getSplitIteration().

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 439 of file Operator.h.

References I.

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

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 426 of file Operator.h.

References llvm::CallingConv::C, and I.

Referenced by DecomposeGEPExpression(), evaluateICmpRelation(), llvm::InstCombiner::FoldGEPICmp(), and shouldMergeGEPs().

bool llvm::GEPOperator::hasIndices ( ) const [inline]

Definition at line 419 of file Operator.h.

References llvm::User::getNumOperands().

Definition at line 389 of file Operator.h.

References llvm::User::op_begin().

Definition at line 391 of file Operator.h.

References llvm::User::op_end().

bool llvm::GEPOperator::isInBounds ( ) const [inline]

isInBounds - Test whether this is an inbounds GEP, as defined by LangRef.html.

Definition at line 384 of file Operator.h.

References llvm::Value::SubclassOptionalData.

Referenced by llvm::EmitGEPOffset(), llvm::InstCombiner::FoldGEPICmp(), and isGEPKnownNonNull().

Friends And Related Function Documentation

friend class ConstantExpr [friend]

Definition at line 375 of file Operator.h.

friend class GetElementPtrInst [friend]

Definition at line 374 of file Operator.h.

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