LLVM API Documentation

llvm::EVT Struct Reference

#include <ValueTypes.h>

Collaboration diagram for llvm::EVT:
[legend]

List of all members.

Public Member Functions

 EVT ()
 EVT (MVT::SimpleValueType SVT)
 EVT (MVT S)
bool operator== (const EVT VT) const
bool operator!= (const EVT VT) const
bool isSimple () const
bool isExtended () const
bool isFloatingPoint () const
 isFloatingPoint - Return true if this is a FP, or a vector FP type.
bool isInteger () const
 isInteger - Return true if this is an integer, or a vector integer type.
bool isVector () const
 isVector - Return true if this is a vector value type.
bool is64BitVector () const
 is64BitVector - Return true if this is a 64-bit vector type.
bool is128BitVector () const
 is128BitVector - Return true if this is a 128-bit vector type.
bool is256BitVector () const
 is256BitVector - Return true if this is a 256-bit vector type.
bool isOverloaded () const
 isOverloaded - Return true if this is an overloaded type for TableGen.
bool isByteSized () const
 isByteSized - Return true if the bit size is a multiple of 8.
bool isRound () const
 isRound - Return true if the size is a power-of-two number of bytes.
bool bitsEq (EVT VT) const
 bitsEq - Return true if this has the same number of bits as VT.
bool bitsGT (EVT VT) const
 bitsGT - Return true if this has more bits than VT.
bool bitsGE (EVT VT) const
 bitsGE - Return true if this has no less bits than VT.
bool bitsLT (EVT VT) const
 bitsLT - Return true if this has less bits than VT.
bool bitsLE (EVT VT) const
 bitsLE - Return true if this has no more bits than VT.
MVT getSimpleVT () const
EVT getVectorElementType () const
unsigned getVectorNumElements () const
unsigned getSizeInBits () const
 getSizeInBits - Return the size of the specified value type in bits.
unsigned getStoreSizeInBits () const
EVT getRoundIntegerType (LLVMContext &Context) const
bool isPow2VectorType () const
 isPow2VectorType - Retuns true if the given vector is a power of 2.
EVT getPow2VectorType (LLVMContext &Context) const
std::string getEVTString () const
 getEVTString - This function returns value type as a string, e.g. "i32".
const Type * getTypeForEVT (LLVMContext &Context) const
intptr_t getRawBits ()

Static Public Member Functions

static EVT getFloatingPointVT (unsigned BitWidth)
static EVT getIntegerVT (LLVMContext &Context, unsigned BitWidth)
static EVT getVectorVT (LLVMContext &Context, EVT VT, unsigned NumElements)
static EVT getIntVectorWithNumElements (LLVMContext &C, unsigned NumElts)
static EVT getEVT (const Type *Ty, bool HandleUnknown=false)

Classes

struct  compareRawBits


Detailed Description

Definition at line 354 of file ValueTypes.h.


Constructor & Destructor Documentation

llvm::EVT::EVT (  )  [inline]

Definition at line 360 of file ValueTypes.h.

Referenced by getRoundIntegerType().

llvm::EVT::EVT ( MVT::SimpleValueType  SVT  )  [inline]

Definition at line 362 of file ValueTypes.h.

llvm::EVT::EVT ( MVT  S  )  [inline]

Definition at line 363 of file ValueTypes.h.


Member Function Documentation

bool llvm::EVT::operator== ( const EVT  VT  )  const [inline]

Definition at line 365 of file ValueTypes.h.

References llvm::MVT::INVALID_SIMPLE_VALUE_TYPE, LLVMTy, llvm::MVT::SimpleTy, and V.

bool llvm::EVT::operator!= ( const EVT  VT  )  const [inline]

Definition at line 373 of file ValueTypes.h.

References llvm::MVT::INVALID_SIMPLE_VALUE_TYPE, LLVMTy, llvm::MVT::SimpleTy, and V.

static EVT llvm::EVT::getFloatingPointVT ( unsigned  BitWidth  )  [inline, static]

getFloatingPointVT - Returns the EVT that represents a floating point type with the given number of bits. There are two floating point types with 128 bits - this returns f128 rather than ppcf128.

Definition at line 385 of file ValueTypes.h.

References llvm::MVT::getFloatingPointVT().

static EVT llvm::EVT::getIntegerVT ( LLVMContext &  Context,
unsigned  BitWidth 
) [inline, static]

static EVT llvm::EVT::getVectorVT ( LLVMContext &  Context,
EVT  VT,
unsigned  NumElements 
) [inline, static]

static EVT llvm::EVT::getIntVectorWithNumElements ( LLVMContext &  C,
unsigned  NumElts 
) [inline, static]

getIntVectorWithNumElements - Return any integer vector type that has the specified number of elements.

Definition at line 411 of file ValueTypes.h.

References llvm::MVT::getIntVectorWithNumElements(), getVectorVT(), llvm::MVT::i8, llvm::MVT::INVALID_SIMPLE_VALUE_TYPE, M, and llvm::MVT::SimpleTy.

bool llvm::EVT::isSimple (  )  const [inline]

bool llvm::EVT::isExtended (  )  const [inline]

isExtended - Test if the given EVT is extended (as opposed to being simple).

Definition at line 427 of file ValueTypes.h.

References isSimple().

Referenced by llvm::TargetLowering::getOperationAction(), llvm::TargetLowering::ValueTypeActionImpl::getTypeAction(), getTypeForEVT(), and llvm::SelectionDAG::getValueType().

bool llvm::EVT::isFloatingPoint (  )  const [inline]

bool llvm::EVT::isInteger (  )  const [inline]

bool llvm::EVT::isVector (  )  const [inline]

bool llvm::EVT::is64BitVector (  )  const [inline]

bool llvm::EVT::is128BitVector (  )  const [inline]

bool llvm::EVT::is256BitVector (  )  const [inline]

is256BitVector - Return true if this is a 256-bit vector type.

Definition at line 471 of file ValueTypes.h.

References isSimple(), llvm::MVT::v16i16, llvm::MVT::v32i8, llvm::MVT::v4f64, llvm::MVT::v4i64, llvm::MVT::v8f32, and llvm::MVT::v8i32.

Referenced by llvm::X86TargetLowering::X86TargetLowering().

bool llvm::EVT::isOverloaded (  )  const [inline]

isOverloaded - Return true if this is an overloaded type for TableGen.

Definition at line 479 of file ValueTypes.h.

References llvm::MVT::fAny, llvm::MVT::iAny, llvm::MVT::iPTRAny, and llvm::MVT::vAny.

bool llvm::EVT::isByteSized (  )  const [inline]

isByteSized - Return true if the bit size is a multiple of 8.

Definition at line 484 of file ValueTypes.h.

References getSizeInBits().

bool llvm::EVT::isRound (  )  const [inline]

isRound - Return true if the size is a power-of-two number of bytes.

Definition at line 489 of file ValueTypes.h.

References getSizeInBits().

Referenced by llvm::TargetLowering::SimplifySetCC().

bool llvm::EVT::bitsEq ( EVT  VT  )  const [inline]

bitsEq - Return true if this has the same number of bits as VT.

Definition at line 495 of file ValueTypes.h.

References getSizeInBits().

Referenced by LowerI8Math().

bool llvm::EVT::bitsGT ( EVT  VT  )  const [inline]

bool llvm::EVT::bitsGE ( EVT  VT  )  const [inline]

bitsGE - Return true if this has no less bits than VT.

Definition at line 505 of file ValueTypes.h.

References getSizeInBits().

Referenced by getMemcpyLoadsAndStores().

bool llvm::EVT::bitsLT ( EVT  VT  )  const [inline]

bool llvm::EVT::bitsLE ( EVT  VT  )  const [inline]

bitsLE - Return true if this has no more bits than VT.

Definition at line 515 of file ValueTypes.h.

References getSizeInBits().

Referenced by llvm::SelectionDAG::getNode().

MVT llvm::EVT::getSimpleVT (  )  const [inline]

getSimpleVT - Return the SimpleValueType held in the specified simple EVT.

Definition at line 522 of file ValueTypes.h.

References isSimple().

Referenced by llvm::TargetLowering::addRegisterClass(), llvm::ARMTargetLowering::allowsUnalignedMemoryAccesses(), EVTToAPFloatSemantics(), ExpandConstantFP(), ExpandUnalignedStore(), llvm::FastISel::FastEmit_rf_(), llvm::TargetLowering::getCondCodeAction(), llvm::TargetLowering::getConvertAction(), llvm::TargetLowering::getIndexedLoadAction(), llvm::TargetLowering::getIndexedStoreAction(), llvm::TargetLowering::getLoadExtAction(), llvm::TargetLowering::getNumRegisters(), llvm::TargetLowering::getOperationAction(), llvm::TargetLowering::getRegClassFor(), llvm::FastISel::getRegForGEPIndex(), llvm::X86TargetLowering::getRegForInlineAsmConstraint(), llvm::FastISel::getRegForValue(), llvm::TargetLowering::getRegisterType(), llvm::SPUTargetLowering::getSetCCResultType(), llvm::TargetLowering::getTruncStoreAction(), llvm::TargetLowering::ValueTypeActionImpl::getTypeAction(), llvm::TargetLowering::getTypeToPromoteTo(), llvm::TargetLowering::getTypeToTransformTo(), llvm::SelectionDAG::getValueType(), llvm::getX86SubSuperRegister(), llvm::TargetRegisterClass::hasType(), isIntS16Immediate(), isLegalAddressImmediate(), llvm::ARMTargetLowering::isLegalAddressingMode(), isLegalT1AddressImmediate(), isLegalT2AddressImmediate(), llvm::ARMTargetLowering::isLegalT2ScaledAddressingMode(), llvm::TargetLowering::isTypeLegal(), LowerBUILD_VECTOR(), llvm::SPUTargetLowering::LowerCall(), llvm::SparcTargetLowering::LowerCall(), LowerCTPOP(), LowerEXTRACT_VECTOR_ELT(), llvm::SPUTargetLowering::LowerFormalArguments(), llvm::SparcTargetLowering::LowerFormalArguments(), LowerSCALAR_TO_VECTOR(), LowerTRUNCATE(), RewriteAsNarrowerShuffle(), llvm::TargetLowering::ValueTypeActionImpl::setTypeAction(), llvm::TargetRegisterClass::vt_end(), X86ChooseCmpImmediateOpcode(), X86ChooseCmpOpcode(), and llvm::X86TargetLowering::X86TargetLowering().

EVT llvm::EVT::getVectorElementType (  )  const [inline]

unsigned llvm::EVT::getVectorNumElements (  )  const [inline]

getVectorNumElements - Given a vector type, return the number of elements it contains.

Definition at line 539 of file ValueTypes.h.

References llvm::MVT::getVectorNumElements(), isSimple(), and isVector().

Referenced by AddNodeIDCustom(), BuildSplat(), BuildSplatI(), CommuteVectorShuffle(), CommuteVectorShuffleMask(), llvm::TargetLowering::computeRegisterProperties(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getConstantFP(), getCopyFromParts(), getCopyToParts(), getEVTString(), llvm::SelectionDAG::getLoad(), llvm::ShuffleVectorSDNode::getMask(), getMemsetStringVal(), getMOVL(), llvm::SelectionDAG::getNode(), getPow2VectorType(), llvm::SelectionDAG::getShuffleScalarElt(), llvm::X86::getShuffleSHUFImmediate(), getShuffleVectorZeroOrUndef(), llvm::TargetLowering::getTypeToTransformTo(), getUnpackh(), getUnpackl(), llvm::SelectionDAG::getVectorShuffle(), llvm::TargetLowering::getVectorTypeBreakdown(), llvm::X86TargetLowering::getWidenVectorType(), isCommutedMOVLMask(), isCommutedSHUFPMask(), llvm::X86::isMOVDDUPMask(), llvm::X86::isMOVHLPS_v_undef_Mask(), llvm::X86::isMOVHLPSMask(), llvm::X86::isMOVHPMask(), isMOVLMask(), llvm::X86::isMOVLPMask(), llvm::X86::isMOVSHDUPMask(), llvm::X86::isMOVSLDUPMask(), isPow2VectorType(), llvm::X86TargetLowering::isShuffleMaskLegal(), llvm::ARMTargetLowering::isShuffleMaskLegal(), isSHUFPMask(), llvm::ShuffleVectorSDNode::isSplatMask(), isUNPCKH_v_undef_Mask(), isUNPCKHMask(), isUNPCKL_v_undef_Mask(), isUNPCKLMask(), llvm::X86TargetLowering::isVectorClearMaskLegal(), isVectorShift(), isVEXTMask(), isVREVMask(), isVTRNMask(), isVUZPMask(), isVZIPMask(), isZeroShuffle(), LowerEXTRACT_VECTOR_ELT(), LowerVECTOR_SHUFFLE(), NormalizeMask(), PerformShiftCombine(), PerformShuffleCombine(), PromoteSplat(), RewriteAsNarrowerShuffle(), ShouldXformToMOVHLPS(), ShouldXformToMOVLP(), and llvm::X86TargetLowering::X86TargetLowering().

unsigned llvm::EVT::getSizeInBits (  )  const [inline]

getSizeInBits - Return the size of the specified value type in bits.

Definition at line 548 of file ValueTypes.h.

References llvm::MVT::getSizeInBits(), and isSimple().

Referenced by bitsEq(), bitsGE(), bitsGT(), bitsLE(), bitsLT(), llvm::TargetLowering::BuildSDIV(), BuildSplat(), CalculateStackSlotSize(), CalculateTailCallArgDest(), CC_MipsO32(), llvm::SelectionDAG::ComputeMaskedBits(), llvm::SelectionDAG::ComputeNumSignBits(), llvm::SPUTargetLowering::ComputeNumSignBitsForTargetNode(), EltsFromConsecutiveLoads(), llvm::PIC16TargetLowering::ExpandLoad(), ExpandUnalignedLoad(), ExpandUnalignedStore(), llvm::FastISel::FastEmit_rf_(), FindAssocWidenVecType(), llvm::SelectionDAG::getConstant(), getCopyFromParts(), llvm::RegsForValue::getCopyFromRegs(), getCopyToParts(), getEVTString(), llvm::SelectionDAG::getGlobalAddress(), getMemcpyLoadsAndStores(), getMemmoveLoadsAndStores(), llvm::MemSDNode::getMemOperand(), getMemsetStores(), getMemsetStringVal(), getMemsetValue(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getNOT(), llvm::TargetLowering::getNumRegisters(), getOnesVector(), llvm::FastISel::getRegForValue(), llvm::SelectionDAGLowering::GetRegistersForValue(), getRoundIntegerType(), getStoreSizeInBits(), llvm::TargetLowering::getTypeToTransformTo(), llvm::SDNode::getValueSizeInBits(), llvm::SDValue::getValueSizeInBits(), llvm::TargetLowering::getVectorTypeBreakdown(), getVectorTypeBreakdownMVT(), getVShift(), llvm::SelectionDAG::getZeroExtendInReg(), getZeroVector(), isByteSized(), llvm::TargetLowering::isConsecutiveLoad(), llvm::BuildVectorSDNode::isConstantSplat(), isMOVLMask(), isRound(), llvm::X86TargetLowering::isShuffleMaskLegal(), llvm::X86TargetLowering::isTruncateFree(), llvm::X86TargetLowering::isVectorClearMaskLegal(), isVREVMask(), isVShiftLImm(), isVShiftRImm(), isVUZPMask(), isVZIPMask(), LowerBUILD_VECTOR(), LowerByteImmed(), LowerCTPOP(), llvm::PIC16TargetLowering::LowerDirectCallArguments(), LowerEXTRACT_VECTOR_ELT(), llvm::SPUTargetLowering::LowerFormalArguments(), llvm::SparcTargetLowering::LowerFormalArguments(), LowerLOAD(), LowerSETCC(), LowerSTORE(), LowerTRUNCATE(), LowerVAARG(), LowerVECTOR_SHUFFLE(), PerformIntrinsicCombine(), PerformShuffleCombine(), PerformVZEXT_MOVLCombine(), llvm::TargetLowering::SimplifyDemandedBits(), llvm::TargetLowering::SimplifySetCC(), and ValueHasExactlyOneBitSet().

unsigned llvm::EVT::getStoreSizeInBits (  )  const [inline]

getStoreSizeInBits - Return the number of bits overwritten by a store of the specified value type.

Definition at line 557 of file ValueTypes.h.

References getSizeInBits().

Referenced by llvm::SelectionDAG::CreateStackTemporary().

EVT llvm::EVT::getRoundIntegerType ( LLVMContext &  Context  )  const [inline]

getRoundIntegerType - Rounds the bit-width of the given integer EVT up to the nearest power of two (and at least to eight), and returns the integer EVT with that number of bits.

Definition at line 564 of file ValueTypes.h.

References EVT(), getIntegerVT(), getSizeInBits(), llvm::MVT::i8, isInteger(), isVector(), and llvm::Log2_32_Ceil().

Referenced by llvm::TargetLowering::ValueTypeActionImpl::getTypeAction(), and llvm::TargetLowering::getTypeToTransformTo().

bool llvm::EVT::isPow2VectorType (  )  const [inline]

isPow2VectorType - Retuns true if the given vector is a power of 2.

Definition at line 574 of file ValueTypes.h.

References getVectorNumElements().

Referenced by getPow2VectorType(), and llvm::TargetLowering::ValueTypeActionImpl::getTypeAction().

EVT llvm::EVT::getPow2VectorType ( LLVMContext &  Context  )  const [inline]

getPow2VectorType - Widens the length of the given vector EVT up to the nearest power of 2 and returns that type.

Definition at line 581 of file ValueTypes.h.

References getVectorElementType(), getVectorNumElements(), getVectorVT(), isPow2VectorType(), and llvm::Log2_32_Ceil().

Referenced by llvm::TargetLowering::getTypeToTransformTo().

std::string EVT::getEVTString (  )  const

const Type * EVT::getTypeForEVT ( LLVMContext &  Context  )  const

getTypeForEVT - This method returns an LLVM type corresponding to the specified EVT. For integer types, this returns an unsigned type. Note that this will abort for types that cannot be represented.

getTypeForEVT - This method returns an LLVM type corresponding to the specified EVT. For integer types, this returns an unsigned type. Note that this will abort for types that cannot be represented.

Definition at line 135 of file ValueTypes.cpp.

References llvm::MVT::f128, llvm::MVT::f32, llvm::MVT::f64, llvm::MVT::f80, llvm::VectorType::get(), llvm::IntegerType::get(), llvm::Type::getDoubleTy(), llvm::Type::getFloatTy(), llvm::Type::getFP128Ty(), llvm::Type::getInt16Ty(), llvm::Type::getInt1Ty(), llvm::Type::getInt32Ty(), llvm::Type::getInt64Ty(), llvm::Type::getInt8Ty(), llvm::Type::getPPC_FP128Ty(), llvm::Type::getVoidTy(), llvm::Type::getX86_FP80Ty(), llvm::MVT::i1, llvm::MVT::i128, llvm::MVT::i16, llvm::MVT::i32, llvm::MVT::i64, llvm::MVT::i8, isExtended(), llvm::MVT::isVoid, llvm::MVT::ppcf128, V, llvm::MVT::v16i16, llvm::MVT::v16i8, llvm::MVT::v1i64, llvm::MVT::v2f32, llvm::MVT::v2f64, llvm::MVT::v2i16, llvm::MVT::v2i32, llvm::MVT::v2i64, llvm::MVT::v2i8, llvm::MVT::v32i8, llvm::MVT::v4f32, llvm::MVT::v4f64, llvm::MVT::v4i16, llvm::MVT::v4i32, llvm::MVT::v4i64, llvm::MVT::v4i8, llvm::MVT::v8f32, llvm::MVT::v8i16, llvm::MVT::v8i32, and llvm::MVT::v8i8.

Referenced by llvm::SelectionDAG::CreateStackTemporary(), ExpandConstantFP(), ExpandLibCall(), and llvm::TargetLowering::LowerCallTo().

EVT EVT::getEVT ( const Type *  Ty,
bool  HandleUnknown = false 
) [static]

getEVT - Return the value type corresponding to the specified type. This returns all pointers as iPTR. If HandleUnknown is true, unknown types are returned as Other, otherwise they are invalid.

getEVT - Return the value type corresponding to the specified type. This returns all pointers as MVT::iPTR. If HandleUnknown is true, unknown types are returned as Other, otherwise they are invalid.

Definition at line 178 of file ValueTypes.cpp.

References llvm::Type::DoubleTyID, llvm::MVT::f128, llvm::MVT::f32, llvm::MVT::f64, llvm::MVT::f80, llvm::Type::FloatTyID, llvm::Type::FP128TyID, llvm::Type::getContext(), llvm::SequentialType::getElementType(), getIntegerVT(), llvm::VectorType::getNumElements(), llvm::Type::getTypeID(), getVectorVT(), llvm::Type::IntegerTyID, llvm::MVT::iPTR, llvm::MVT::isVoid, llvm_unreachable, llvm::MVT::Other, llvm::Type::PointerTyID, llvm::Type::PPC_FP128TyID, llvm::MVT::ppcf128, llvm::Type::VectorTyID, llvm::Type::VoidTyID, and llvm::Type::X86_FP80TyID.

Referenced by llvm::Intrinsic::getName(), llvm::FastISel::getRegForGEPIndex(), and llvm::TargetLowering::getValueType().

intptr_t llvm::EVT::getRawBits (  )  [inline]


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