LLVM  mainline
Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends
llvm::ConstantDataVector Class Reference

#include <Constants.h>

Inheritance diagram for llvm::ConstantDataVector:
Inheritance graph
[legend]
Collaboration diagram for llvm::ConstantDataVector:
Collaboration graph
[legend]

List of all members.

Public Member Functions

ConstantgetSplatValue () const
VectorTypegetType () const

Static Public Member Functions

static Constantget (LLVMContext &Context, ArrayRef< uint8_t > Elts)
static Constantget (LLVMContext &Context, ArrayRef< uint16_t > Elts)
static Constantget (LLVMContext &Context, ArrayRef< uint32_t > Elts)
static Constantget (LLVMContext &Context, ArrayRef< uint64_t > Elts)
static Constantget (LLVMContext &Context, ArrayRef< float > Elts)
static Constantget (LLVMContext &Context, ArrayRef< double > Elts)
static ConstantgetFP (LLVMContext &Context, ArrayRef< uint16_t > Elts)
static ConstantgetFP (LLVMContext &Context, ArrayRef< uint32_t > Elts)
static ConstantgetFP (LLVMContext &Context, ArrayRef< uint64_t > Elts)
static ConstantgetSplat (unsigned NumElts, Constant *Elt)
static bool classof (const Value *V)

Protected Member Functions

void * operator new (size_t s)

Friends

class ConstantDataSequential

Detailed Description

ConstantDataVector - A vector constant whose element type is a simple 1/2/4/8-byte integer or float/double, and whose elements are just simple data values (i.e. ConstantInt/ConstantFP). This Constant node has no operands because it stores all of the elements of the constant as densely packed data, instead of as Value*'s.

Definition at line 716 of file Constants.h.


Member Function Documentation

static bool llvm::ConstantDataVector::classof ( const Value V) [inline, static]

Methods for support type inquiry through isa, cast, and dyn_cast:

Reimplemented from llvm::ConstantDataSequential.

Definition at line 767 of file Constants.h.

References llvm::Value::ConstantDataVectorVal, and llvm::Value::getValueID().

Constant * ConstantDataVector::get ( LLVMContext Context,
ArrayRef< uint8_t >  Elts 
) [static]

get() constructors - Return a constant with vector type with an element count and element type matching the ArrayRef passed in. Note that this can return a ConstantAggregateZero object.

Definition at line 2598 of file Constants.cpp.

References llvm::ArrayRef< T >::data(), llvm::Data, llvm::ConstantDataSequential::getImpl(), llvm::Type::getInt8Ty(), and llvm::ArrayRef< T >::size().

Referenced by get(), getFP(), OptimizeVectorResize(), and llvm::InstCombiner::visitCallInst().

Constant * ConstantDataVector::get ( LLVMContext Context,
ArrayRef< uint16_t >  Elts 
) [static]
Constant * ConstantDataVector::get ( LLVMContext Context,
ArrayRef< uint32_t >  Elts 
) [static]
Constant * ConstantDataVector::get ( LLVMContext Context,
ArrayRef< uint64_t >  Elts 
) [static]
Constant * ConstantDataVector::get ( LLVMContext Context,
ArrayRef< float >  Elts 
) [static]
Constant * ConstantDataVector::get ( LLVMContext Context,
ArrayRef< double >  Elts 
) [static]
Constant * ConstantDataVector::getFP ( LLVMContext Context,
ArrayRef< uint16_t >  Elts 
) [static]

getFP() constructors - Return a constant with vector type with an element count and element type of float with the precision matching the number of bits in the ArrayRef passed in. (i.e. half for 16bits, float for 32bits, double for 64bits) Note that this can return a ConstantAggregateZero object.

Definition at line 2634 of file Constants.cpp.

References llvm::ArrayRef< T >::data(), llvm::Data, get(), llvm::Type::getHalfTy(), llvm::ConstantDataSequential::getImpl(), and llvm::ArrayRef< T >::size().

Referenced by getSplat().

Constant * ConstantDataVector::getFP ( LLVMContext Context,
ArrayRef< uint32_t >  Elts 
) [static]
Constant * ConstantDataVector::getFP ( LLVMContext Context,
ArrayRef< uint64_t >  Elts 
) [static]
Constant * ConstantDataVector::getSplat ( unsigned  NumElts,
Constant Elt 
) [static]

getSplat - Return a ConstantVector with the specified constant in each element. The specified constant has to be a of a compatible type (i8/i16/ i32/i64/float/double) and must be a ConstantFP or ConstantInt.

Definition at line 2653 of file Constants.cpp.

References llvm::Value::getContext(), getFP(), llvm::Value::getType(), and llvm::ConstantDataSequential::isElementTypeCompatible().

getSplatValue - If this is a splat constant, meaning that all of the elements have the same value, return that value. Otherwise return NULL.

getSplatValue - If this is a splat constant, meaning that all of the elements have the same value, return that value. Otherwise return nullptr.

Reimplemented from llvm::Constant.

Definition at line 2782 of file Constants.cpp.

References llvm::StringRef::data(), llvm::ConstantDataSequential::getElementAsConstant(), llvm::ConstantDataSequential::getElementByteSize(), llvm::ConstantDataSequential::getNumElements(), and llvm::ConstantDataSequential::getRawDataValues().

getType - Specialize the getType() method to always return a VectorType, which reduces the amount of casting needed in parts of the compiler.

Reimplemented from llvm::ConstantDataSequential.

Definition at line 761 of file Constants.h.

void* llvm::ConstantDataVector::operator new ( size_t  s) [inline, protected]

Reimplemented from llvm::ConstantDataSequential.

Definition at line 725 of file Constants.h.

References operator new().


Friends And Related Function Documentation

friend class ConstantDataSequential [friend]

Definition at line 720 of file Constants.h.


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