LLVM  4.0.0
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
llvm::LLT Class Reference

#include <LowLevelType.h>

Public Types

enum  TypeKind : uint16_t { Invalid, Scalar, Pointer, Vector }
 

Public Member Functions

 LLT (TypeKind Kind, uint16_t NumElements, unsigned SizeInBits)
 
 LLT ()
 
 LLT (Type &Ty, const DataLayout &DL)
 Construct a low-level type based on an LLVM type. More...
 
 LLT (MVT VT)
 
bool isValid () const
 
bool isScalar () const
 
bool isPointer () const
 
bool isVector () const
 
uint16_t getNumElements () const
 Returns the number of elements in a vector LLT. More...
 
unsigned getSizeInBits () const
 Returns the total size of the type. Must only be called on sized types. More...
 
unsigned getScalarSizeInBits () const
 
unsigned getAddressSpace () const
 
LLT getElementType () const
 Returns the vector's element type. Only valid for vector types. More...
 
LLT halfScalarSize () const
 Get a low-level type with half the size of the original, by halving the size of the scalar type involved. More...
 
LLT doubleScalarSize () const
 Get a low-level type with twice the size of the original, by doubling the size of the scalar type involved. More...
 
LLT halfElements () const
 Get a low-level type with half the size of the original, by halving the number of vector elements of the scalar type involved. More...
 
LLT doubleElements () const
 Get a low-level type with twice the size of the original, by doubling the number of vector elements of the scalar type involved. More...
 
void print (raw_ostream &OS) const
 
bool operator== (const LLT &RHS) const
 
bool operator!= (const LLT &RHS) const
 

Static Public Member Functions

static LLT scalar (unsigned SizeInBits)
 Get a low-level scalar or aggregate "bag of bits". More...
 
static LLT pointer (uint16_t AddressSpace, unsigned SizeInBits)
 Get a low-level pointer in the given address space (defaulting to 0). More...
 
static LLT vector (uint16_t NumElements, unsigned ScalarSizeInBits)
 Get a low-level vector of some number of elements and element width. More...
 
static LLT vector (uint16_t NumElements, LLT ScalarTy)
 Get a low-level vector of some number of elements and element type. More...
 

Friends

struct DenseMapInfo< LLT >
 

Detailed Description

Definition at line 41 of file LowLevelType.h.

Member Enumeration Documentation

enum llvm::LLT::TypeKind : uint16_t
Enumerator
Invalid 
Scalar 
Pointer 
Vector 

Definition at line 43 of file LowLevelType.h.

Constructor & Destructor Documentation

llvm::LLT::LLT ( TypeKind  Kind,
uint16_t  NumElements,
unsigned  SizeInBits 
)
inlineexplicit

Definition at line 75 of file LowLevelType.h.

References assert(), and Vector.

llvm::LLT::LLT ( )
inlineexplicit

Definition at line 81 of file LowLevelType.h.

LLT::LLT ( Type Ty,
const DataLayout DL 
)
explicit

Construct a low-level type based on an LLVM type.

Definition at line 21 of file LowLevelType.cpp.

References assert(), llvm::DataLayout::getTypeSizeInBits(), Invalid, llvm::Type::isSized(), Pointer, Scalar, and Vector.

LLT::LLT ( MVT  VT)
explicit

Member Function Documentation

LLT llvm::LLT::doubleElements ( ) const
inline

Get a low-level type with twice the size of the original, by doubling the number of vector elements of the scalar type involved.

The source must be a vector type. For example <2 x s32> will become <4 x s32>. Doubling the number of elements in sN produces <2 x sN>.

Definition at line 160 of file LowLevelType.h.

References assert(), isPointer(), print(), and Vector.

Referenced by llvm::LegalizerInfo::findLegalType().

LLT llvm::LLT::doubleScalarSize ( ) const
inline

Get a low-level type with twice the size of the original, by doubling the size of the scalar type involved.

For example s32 will become s64, <2 x s32> will become <2 x s64>.

Definition at line 137 of file LowLevelType.h.

References assert(), and isPointer().

Referenced by llvm::LegalizerInfo::findLegalType().

unsigned llvm::LLT::getAddressSpace ( ) const
inline

Definition at line 114 of file LowLevelType.h.

References assert(), and isPointer().

Referenced by llvm::MachineIRBuilder::buildGlobalValue(), and print().

LLT llvm::LLT::getElementType ( ) const
inline

Returns the vector's element type. Only valid for vector types.

Definition at line 120 of file LowLevelType.h.

References assert(), isVector(), and scalar().

Referenced by llvm::LegalizerInfo::computeTables(), and llvm::LegalizerInfo::getAction().

uint16_t llvm::LLT::getNumElements ( ) const
inline

Returns the number of elements in a vector LLT.

Must only be called on vector types.

Definition at line 98 of file LowLevelType.h.

References assert(), and isVector().

Referenced by llvm::MachineIRBuilder::buildFCmp(), llvm::MachineIRBuilder::buildICmp(), llvm::MachineIRBuilder::buildSelect(), llvm::LegalizerInfo::computeTables(), and llvm::LegalizerInfo::getAction().

unsigned llvm::LLT::getScalarSizeInBits ( ) const
inline

Definition at line 110 of file LowLevelType.h.

Referenced by halfScalarSize(), and print().

unsigned llvm::LLT::getSizeInBits ( ) const
inline
LLT llvm::LLT::halfElements ( ) const
inline

Get a low-level type with half the size of the original, by halving the number of vector elements of the scalar type involved.

The source must be a vector type with an even number of elements. For example <4 x s32> will become <2 x s32>, <2 x s32> will become s32.

Definition at line 146 of file LowLevelType.h.

References assert(), isVector(), scalar(), and Vector.

Referenced by llvm::LegalizerInfo::findLegalType().

LLT llvm::LLT::halfScalarSize ( ) const
inline

Get a low-level type with half the size of the original, by halving the size of the scalar type involved.

For example s32 will become s16, <2 x s32> will become <2 x s16>.

Definition at line 128 of file LowLevelType.h.

References assert(), getScalarSizeInBits(), and isPointer().

Referenced by llvm::LegalizerInfo::findLegalType().

bool llvm::LLT::isPointer ( ) const
inline
bool llvm::LLT::isScalar ( ) const
inline
bool llvm::LLT::isValid ( ) const
inline
bool llvm::LLT::isVector ( ) const
inline
bool llvm::LLT::operator!= ( const LLT RHS) const
inline

Definition at line 173 of file LowLevelType.h.

bool llvm::LLT::operator== ( const LLT RHS) const
inline

Definition at line 168 of file LowLevelType.h.

static LLT llvm::LLT::pointer ( uint16_t  AddressSpace,
unsigned  SizeInBits 
)
inlinestatic
void LLT::print ( raw_ostream OS) const
static LLT llvm::LLT::scalar ( unsigned  SizeInBits)
inlinestatic
static LLT llvm::LLT::vector ( uint16_t  NumElements,
unsigned  ScalarSizeInBits 
)
inlinestatic

Get a low-level vector of some number of elements and element width.

NumElements must be at least 2.

Definition at line 63 of file LowLevelType.h.

References assert(), and Vector.

Referenced by llvm::AArch64LegalizerInfo::AArch64LegalizerInfo(), and llvm::AArch64InstructionSelector::select().

static LLT llvm::LLT::vector ( uint16_t  NumElements,
LLT  ScalarTy 
)
inlinestatic

Get a low-level vector of some number of elements and element type.

Definition at line 69 of file LowLevelType.h.

References assert(), getSizeInBits(), isScalar(), and Vector.

Friends And Related Function Documentation

friend struct DenseMapInfo< LLT >
friend

Definition at line 175 of file LowLevelType.h.


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