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
[legend]
Collaboration diagram for llvm::GEPOperator:
Collaboration graph
[legend]

List of all members.

Public Member Functions

bool isInBounds () const
 Test whether this is an inbounds GEP, as defined by LangRef.html.
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
 Method to return the pointer operand as a PointerType.
unsigned getPointerAddressSpace () const
 Method to return the address space of the pointer operand.
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 ()

Friends

class GetElementPtrInst
class ConstantExpr

Detailed Description

Definition at line 362 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 446 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 406 of file Operator.h.

References llvm::User::getNumOperands().

Method to return the address space of the pointer operand.

Definition at line 402 of file Operator.h.

Referenced by DecomposeGEPExpression(), and isGEPKnownNonNull().

Definition at line 389 of file Operator.h.

References llvm::User::getOperand().

Definition at line 392 of file Operator.h.

Method to return the pointer operand as a PointerType.

Definition at line 397 of file Operator.h.

References getPointerOperand().

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

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

References I.

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

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

References llvm::User::getNumOperands().

Definition at line 382 of file Operator.h.

References llvm::User::op_begin().

Definition at line 384 of file Operator.h.

References llvm::User::op_end().

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

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

Definition at line 377 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 369 of file Operator.h.

friend class GetElementPtrInst [friend]

Definition at line 368 of file Operator.h.


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