22 if (
auto VTy = dyn_cast<VectorType>(&Ty)) {
23 SizeInBits = VTy->getElementType()->getPrimitiveSizeInBits();
24 ElementsOrAddrSpace = VTy->getNumElements();
26 }
else if (
auto PTy = dyn_cast<PointerType>(&Ty)) {
29 ElementsOrAddrSpace = PTy->getAddressSpace();
35 ElementsOrAddrSpace = 1;
36 assert(SizeInBits != 0 &&
"invalid zero-sized type");
39 SizeInBits = ElementsOrAddrSpace = 0;
53 ElementsOrAddrSpace = 1;
54 assert(SizeInBits != 0 &&
"invalid zero-sized type");
57 SizeInBits = ElementsOrAddrSpace = 0;
63 OS <<
"<" << ElementsOrAddrSpace <<
" x s" << SizeInBits <<
">";
A parsed version of the target data layout string in and methods for querying it. ...
unsigned getSizeInBits() const
unsigned getScalarSizeInBits() const
unsigned getAddressSpace() const
bool isSized(SmallPtrSetImpl< Type * > *Visited=nullptr) const
Return true if it makes sense to take the size of this type.
unsigned getVectorNumElements() const
MVT - Machine Value Type.
The instances of the Type class are immutable: once they are created, they are never changed...
bool isVector() const
isVector - Return true if this is a vector value type.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
bool isValid() const
isValid - Return true if this is a valid simple valuetype.
void print(raw_ostream &OS) const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
uint64_t getTypeSizeInBits(Type *Ty) const
Size examples:
This class implements an extremely fast bulk output stream that can only output to a stream...
MVT getVectorElementType() const