LLVM 17.0.0git
Type.cpp
Go to the documentation of this file.
1//===- Type.cpp - Implement the Type class --------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file implements the Type class for the IR library.
10//
11//===----------------------------------------------------------------------===//
12
13#include "llvm/IR/Type.h"
14#include "LLVMContextImpl.h"
15#include "llvm/ADT/APInt.h"
17#include "llvm/ADT/StringMap.h"
18#include "llvm/ADT/StringRef.h"
19#include "llvm/IR/Constant.h"
20#include "llvm/IR/Constants.h"
22#include "llvm/IR/LLVMContext.h"
23#include "llvm/IR/Value.h"
27#include <cassert>
28#include <utility>
29
30using namespace llvm;
31
32//===----------------------------------------------------------------------===//
33// Type Class Implementation
34//===----------------------------------------------------------------------===//
35
37 switch (IDNumber) {
38 case VoidTyID : return getVoidTy(C);
39 case HalfTyID : return getHalfTy(C);
40 case BFloatTyID : return getBFloatTy(C);
41 case FloatTyID : return getFloatTy(C);
42 case DoubleTyID : return getDoubleTy(C);
43 case X86_FP80TyID : return getX86_FP80Ty(C);
44 case FP128TyID : return getFP128Ty(C);
45 case PPC_FP128TyID : return getPPC_FP128Ty(C);
46 case LabelTyID : return getLabelTy(C);
47 case MetadataTyID : return getMetadataTy(C);
48 case X86_MMXTyID : return getX86_MMXTy(C);
49 case X86_AMXTyID : return getX86_AMXTy(C);
50 case TokenTyID : return getTokenTy(C);
51 default:
52 return nullptr;
53 }
54}
55
56bool Type::isIntegerTy(unsigned Bitwidth) const {
57 return isIntegerTy() && cast<IntegerType>(this)->getBitWidth() == Bitwidth;
58}
59
60bool Type::isOpaquePointerTy() const {
61 if (auto *PTy = dyn_cast<PointerType>(this))
62 return PTy->isOpaque();
63 return false;
64}
65
67 switch (getTypeID()) {
68 case HalfTyID: return APFloat::IEEEhalf();
69 case BFloatTyID: return APFloat::BFloat();
70 case FloatTyID: return APFloat::IEEEsingle();
71 case DoubleTyID: return APFloat::IEEEdouble();
73 case FP128TyID: return APFloat::IEEEquad();
75 default: llvm_unreachable("Invalid floating type");
76 }
77}
78
79bool Type::isIEEE() const {
81}
82
84 Type *Ty;
85 if (&S == &APFloat::IEEEhalf())
86 Ty = Type::getHalfTy(C);
87 else if (&S == &APFloat::BFloat())
88 Ty = Type::getBFloatTy(C);
89 else if (&S == &APFloat::IEEEsingle())
90 Ty = Type::getFloatTy(C);
91 else if (&S == &APFloat::IEEEdouble())
92 Ty = Type::getDoubleTy(C);
93 else if (&S == &APFloat::x87DoubleExtended())
95 else if (&S == &APFloat::IEEEquad())
96 Ty = Type::getFP128Ty(C);
97 else {
98 assert(&S == &APFloat::PPCDoubleDouble() && "Unknown FP format");
100 }
101 return Ty;
102}
103
104bool Type::canLosslesslyBitCastTo(Type *Ty) const {
105 // Identity cast means no change so return true
106 if (this == Ty)
107 return true;
108
109 // They are not convertible unless they are at least first class types
110 if (!this->isFirstClassType() || !Ty->isFirstClassType())
111 return false;
112
113 // Vector -> Vector conversions are always lossless if the two vector types
114 // have the same size, otherwise not.
115 if (isa<VectorType>(this) && isa<VectorType>(Ty))
117
118 // 64-bit fixed width vector types can be losslessly converted to x86mmx.
119 if (((isa<FixedVectorType>(this)) && Ty->isX86_MMXTy()) &&
120 getPrimitiveSizeInBits().getFixedValue() == 64)
121 return true;
122 if ((isX86_MMXTy() && isa<FixedVectorType>(Ty)) &&
124 return true;
125
126 // 8192-bit fixed width vector types can be losslessly converted to x86amx.
127 if (((isa<FixedVectorType>(this)) && Ty->isX86_AMXTy()) &&
128 getPrimitiveSizeInBits().getFixedValue() == 8192)
129 return true;
130 if ((isX86_AMXTy() && isa<FixedVectorType>(Ty)) &&
132 return true;
133
134 // At this point we have only various mismatches of the first class types
135 // remaining and ptr->ptr. Just select the lossless conversions. Everything
136 // else is not lossless. Conservatively assume we can't losslessly convert
137 // between pointers with different address spaces.
138 if (auto *PTy = dyn_cast<PointerType>(this)) {
139 if (auto *OtherPTy = dyn_cast<PointerType>(Ty))
140 return PTy->getAddressSpace() == OtherPTy->getAddressSpace();
141 return false;
142 }
143 return false; // Other types have no identity values
144}
145
146bool Type::isEmptyTy() const {
147 if (auto *ATy = dyn_cast<ArrayType>(this)) {
148 unsigned NumElements = ATy->getNumElements();
149 return NumElements == 0 || ATy->getElementType()->isEmptyTy();
150 }
151
152 if (auto *STy = dyn_cast<StructType>(this)) {
153 unsigned NumElements = STy->getNumElements();
154 for (unsigned i = 0; i < NumElements; ++i)
155 if (!STy->getElementType(i)->isEmptyTy())
156 return false;
157 return true;
158 }
159
160 return false;
161}
162
164 switch (getTypeID()) {
165 case Type::HalfTyID: return TypeSize::Fixed(16);
166 case Type::BFloatTyID: return TypeSize::Fixed(16);
167 case Type::FloatTyID: return TypeSize::Fixed(32);
168 case Type::DoubleTyID: return TypeSize::Fixed(64);
169 case Type::X86_FP80TyID: return TypeSize::Fixed(80);
170 case Type::FP128TyID: return TypeSize::Fixed(128);
171 case Type::PPC_FP128TyID: return TypeSize::Fixed(128);
172 case Type::X86_MMXTyID: return TypeSize::Fixed(64);
173 case Type::X86_AMXTyID: return TypeSize::Fixed(8192);
175 return TypeSize::Fixed(cast<IntegerType>(this)->getBitWidth());
178 const VectorType *VTy = cast<VectorType>(this);
179 ElementCount EC = VTy->getElementCount();
180 TypeSize ETS = VTy->getElementType()->getPrimitiveSizeInBits();
181 assert(!ETS.isScalable() && "Vector type should have fixed-width elements");
182 return {ETS.getFixedValue() * EC.getKnownMinValue(), EC.isScalable()};
183 }
184 default: return TypeSize::Fixed(0);
185 }
186}
187
188unsigned Type::getScalarSizeInBits() const {
189 // It is safe to assume that the scalar types have a fixed size.
191}
192
193int Type::getFPMantissaWidth() const {
194 if (auto *VTy = dyn_cast<VectorType>(this))
195 return VTy->getElementType()->getFPMantissaWidth();
196 assert(isFloatingPointTy() && "Not a floating point type!");
197 if (getTypeID() == HalfTyID) return 11;
198 if (getTypeID() == BFloatTyID) return 8;
199 if (getTypeID() == FloatTyID) return 24;
200 if (getTypeID() == DoubleTyID) return 53;
201 if (getTypeID() == X86_FP80TyID) return 64;
202 if (getTypeID() == FP128TyID) return 113;
203 assert(getTypeID() == PPC_FP128TyID && "unknown fp type");
204 return -1;
205}
206
207bool Type::isSizedDerivedType(SmallPtrSetImpl<Type*> *Visited) const {
208 if (auto *ATy = dyn_cast<ArrayType>(this))
209 return ATy->getElementType()->isSized(Visited);
210
211 if (auto *VTy = dyn_cast<VectorType>(this))
212 return VTy->getElementType()->isSized(Visited);
213
214 if (auto *TTy = dyn_cast<TargetExtType>(this))
215 return TTy->getLayoutType()->isSized(Visited);
216
217 return cast<StructType>(this)->isSized(Visited);
218}
219
220//===----------------------------------------------------------------------===//
221// Primitive 'Type' data
222//===----------------------------------------------------------------------===//
223
224Type *Type::getVoidTy(LLVMContext &C) { return &C.pImpl->VoidTy; }
225Type *Type::getLabelTy(LLVMContext &C) { return &C.pImpl->LabelTy; }
226Type *Type::getHalfTy(LLVMContext &C) { return &C.pImpl->HalfTy; }
227Type *Type::getBFloatTy(LLVMContext &C) { return &C.pImpl->BFloatTy; }
228Type *Type::getFloatTy(LLVMContext &C) { return &C.pImpl->FloatTy; }
229Type *Type::getDoubleTy(LLVMContext &C) { return &C.pImpl->DoubleTy; }
230Type *Type::getMetadataTy(LLVMContext &C) { return &C.pImpl->MetadataTy; }
231Type *Type::getTokenTy(LLVMContext &C) { return &C.pImpl->TokenTy; }
232Type *Type::getX86_FP80Ty(LLVMContext &C) { return &C.pImpl->X86_FP80Ty; }
233Type *Type::getFP128Ty(LLVMContext &C) { return &C.pImpl->FP128Ty; }
234Type *Type::getPPC_FP128Ty(LLVMContext &C) { return &C.pImpl->PPC_FP128Ty; }
235Type *Type::getX86_MMXTy(LLVMContext &C) { return &C.pImpl->X86_MMXTy; }
236Type *Type::getX86_AMXTy(LLVMContext &C) { return &C.pImpl->X86_AMXTy; }
237
238IntegerType *Type::getInt1Ty(LLVMContext &C) { return &C.pImpl->Int1Ty; }
239IntegerType *Type::getInt8Ty(LLVMContext &C) { return &C.pImpl->Int8Ty; }
240IntegerType *Type::getInt16Ty(LLVMContext &C) { return &C.pImpl->Int16Ty; }
241IntegerType *Type::getInt32Ty(LLVMContext &C) { return &C.pImpl->Int32Ty; }
242IntegerType *Type::getInt64Ty(LLVMContext &C) { return &C.pImpl->Int64Ty; }
243IntegerType *Type::getInt128Ty(LLVMContext &C) { return &C.pImpl->Int128Ty; }
244
246 return IntegerType::get(C, N);
247}
248
250 return getHalfTy(C)->getPointerTo(AS);
251}
252
254 return getBFloatTy(C)->getPointerTo(AS);
255}
256
258 return getFloatTy(C)->getPointerTo(AS);
259}
260
262 return getDoubleTy(C)->getPointerTo(AS);
263}
264
266 return getX86_FP80Ty(C)->getPointerTo(AS);
267}
268
270 return getFP128Ty(C)->getPointerTo(AS);
271}
272
274 return getPPC_FP128Ty(C)->getPointerTo(AS);
275}
276
278 return getX86_MMXTy(C)->getPointerTo(AS);
279}
280
282 return getX86_AMXTy(C)->getPointerTo(AS);
283}
284
285PointerType *Type::getIntNPtrTy(LLVMContext &C, unsigned N, unsigned AS) {
286 return getIntNTy(C, N)->getPointerTo(AS);
287}
288
290 return getInt1Ty(C)->getPointerTo(AS);
291}
292
294 return getInt8Ty(C)->getPointerTo(AS);
295}
296
298 return getInt16Ty(C)->getPointerTo(AS);
299}
300
302 return getInt32Ty(C)->getPointerTo(AS);
303}
304
306 return getInt64Ty(C)->getPointerTo(AS);
307}
308
310 // opaque pointer in addrspace(10)
311 static PointerType *Ty = PointerType::get(C, 10);
312 return Ty;
313}
314
316 // opaque pointer in addrspace(20)
317 static PointerType *Ty = PointerType::get(C, 20);
318 return Ty;
319}
320
321//===----------------------------------------------------------------------===//
322// IntegerType Implementation
323//===----------------------------------------------------------------------===//
324
326 assert(NumBits >= MIN_INT_BITS && "bitwidth too small");
327 assert(NumBits <= MAX_INT_BITS && "bitwidth too large");
328
329 // Check for the built-in integer types
330 switch (NumBits) {
331 case 1: return cast<IntegerType>(Type::getInt1Ty(C));
332 case 8: return cast<IntegerType>(Type::getInt8Ty(C));
333 case 16: return cast<IntegerType>(Type::getInt16Ty(C));
334 case 32: return cast<IntegerType>(Type::getInt32Ty(C));
335 case 64: return cast<IntegerType>(Type::getInt64Ty(C));
336 case 128: return cast<IntegerType>(Type::getInt128Ty(C));
337 default:
338 break;
339 }
340
341 IntegerType *&Entry = C.pImpl->IntegerTypes[NumBits];
342
343 if (!Entry)
344 Entry = new (C.pImpl->Alloc) IntegerType(C, NumBits);
345
346 return Entry;
347}
348
350
351//===----------------------------------------------------------------------===//
352// FunctionType Implementation
353//===----------------------------------------------------------------------===//
354
355FunctionType::FunctionType(Type *Result, ArrayRef<Type*> Params,
356 bool IsVarArgs)
357 : Type(Result->getContext(), FunctionTyID) {
358 Type **SubTys = reinterpret_cast<Type**>(this+1);
359 assert(isValidReturnType(Result) && "invalid return type for function");
360 setSubclassData(IsVarArgs);
361
362 SubTys[0] = Result;
363
364 for (unsigned i = 0, e = Params.size(); i != e; ++i) {
365 assert(isValidArgumentType(Params[i]) &&
366 "Not a valid type for function argument!");
367 SubTys[i+1] = Params[i];
368 }
369
370 ContainedTys = SubTys;
371 NumContainedTys = Params.size() + 1; // + 1 for result type
372}
373
374// This is the factory function for the FunctionType class.
376 ArrayRef<Type*> Params, bool isVarArg) {
377 LLVMContextImpl *pImpl = ReturnType->getContext().pImpl;
378 const FunctionTypeKeyInfo::KeyTy Key(ReturnType, Params, isVarArg);
379 FunctionType *FT;
380 // Since we only want to allocate a fresh function type in case none is found
381 // and we don't want to perform two lookups (one for checking if existent and
382 // one for inserting the newly allocated one), here we instead lookup based on
383 // Key and update the reference to the function type in-place to a newly
384 // allocated one if not found.
385 auto Insertion = pImpl->FunctionTypes.insert_as(nullptr, Key);
386 if (Insertion.second) {
387 // The function type was not found. Allocate one and update FunctionTypes
388 // in-place.
389 FT = (FunctionType *)pImpl->Alloc.Allocate(
390 sizeof(FunctionType) + sizeof(Type *) * (Params.size() + 1),
391 alignof(FunctionType));
392 new (FT) FunctionType(ReturnType, Params, isVarArg);
393 *Insertion.first = FT;
394 } else {
395 // The function type was found. Just return it.
396 FT = *Insertion.first;
397 }
398 return FT;
399}
400
401FunctionType *FunctionType::get(Type *Result, bool isVarArg) {
402 return get(Result, std::nullopt, isVarArg);
403}
404
406 return !RetTy->isFunctionTy() && !RetTy->isLabelTy() &&
407 !RetTy->isMetadataTy();
408}
409
411 return ArgTy->isFirstClassType();
412}
413
414//===----------------------------------------------------------------------===//
415// StructType Implementation
416//===----------------------------------------------------------------------===//
417
418// Primitive Constructors.
419
421 bool isPacked) {
423 const AnonStructTypeKeyInfo::KeyTy Key(ETypes, isPacked);
424
425 StructType *ST;
426 // Since we only want to allocate a fresh struct type in case none is found
427 // and we don't want to perform two lookups (one for checking if existent and
428 // one for inserting the newly allocated one), here we instead lookup based on
429 // Key and update the reference to the struct type in-place to a newly
430 // allocated one if not found.
431 auto Insertion = pImpl->AnonStructTypes.insert_as(nullptr, Key);
432 if (Insertion.second) {
433 // The struct type was not found. Allocate one and update AnonStructTypes
434 // in-place.
435 ST = new (Context.pImpl->Alloc) StructType(Context);
436 ST->setSubclassData(SCDB_IsLiteral); // Literal struct.
437 ST->setBody(ETypes, isPacked);
438 *Insertion.first = ST;
439 } else {
440 // The struct type was found. Just return it.
441 ST = *Insertion.first;
442 }
443
444 return ST;
445}
446
448 for (Type *Ty : elements()) {
449 if (isa<ScalableVectorType>(Ty))
450 return true;
451 if (auto *STy = dyn_cast<StructType>(Ty))
452 if (STy->containsScalableVectorType())
453 return true;
454 }
455
456 return false;
457}
458
459void StructType::setBody(ArrayRef<Type*> Elements, bool isPacked) {
460 assert(isOpaque() && "Struct body already set!");
461
462 setSubclassData(getSubclassData() | SCDB_HasBody);
463 if (isPacked)
464 setSubclassData(getSubclassData() | SCDB_Packed);
465
466 NumContainedTys = Elements.size();
467
468 if (Elements.empty()) {
469 ContainedTys = nullptr;
470 return;
471 }
472
473 ContainedTys = Elements.copy(getContext().pImpl->Alloc).data();
474}
475
477 if (Name == getName()) return;
478
480
482
483 // If this struct already had a name, remove its symbol table entry. Don't
484 // delete the data yet because it may be part of the new name.
486 SymbolTable.remove((EntryTy *)SymbolTableEntry);
487
488 // If this is just removing the name, we're done.
489 if (Name.empty()) {
490 if (SymbolTableEntry) {
491 // Delete the old string data.
492 ((EntryTy *)SymbolTableEntry)->Destroy(SymbolTable.getAllocator());
493 SymbolTableEntry = nullptr;
494 }
495 return;
496 }
497
498 // Look up the entry for the name.
499 auto IterBool =
500 getContext().pImpl->NamedStructTypes.insert(std::make_pair(Name, this));
501
502 // While we have a name collision, try a random rename.
503 if (!IterBool.second) {
504 SmallString<64> TempStr(Name);
505 TempStr.push_back('.');
506 raw_svector_ostream TmpStream(TempStr);
507 unsigned NameSize = Name.size();
508
509 do {
510 TempStr.resize(NameSize + 1);
511 TmpStream << getContext().pImpl->NamedStructTypesUniqueID++;
512
513 IterBool = getContext().pImpl->NamedStructTypes.insert(
514 std::make_pair(TmpStream.str(), this));
515 } while (!IterBool.second);
516 }
517
518 // Delete the old string data.
520 ((EntryTy *)SymbolTableEntry)->Destroy(SymbolTable.getAllocator());
521 SymbolTableEntry = &*IterBool.first;
522}
523
524//===----------------------------------------------------------------------===//
525// StructType Helper functions.
526
529 if (!Name.empty())
530 ST->setName(Name);
531 return ST;
532}
533
534StructType *StructType::get(LLVMContext &Context, bool isPacked) {
535 return get(Context, std::nullopt, isPacked);
536}
537
539 StringRef Name, bool isPacked) {
541 ST->setBody(Elements, isPacked);
542 return ST;
543}
544
546 return create(Context, Elements, StringRef());
547}
548
550 return create(Context, StringRef());
551}
552
554 bool isPacked) {
555 assert(!Elements.empty() &&
556 "This method may not be invoked with an empty list");
557 return create(Elements[0]->getContext(), Elements, Name, isPacked);
558}
559
561 assert(!Elements.empty() &&
562 "This method may not be invoked with an empty list");
563 return create(Elements[0]->getContext(), Elements, StringRef());
564}
565
567 if ((getSubclassData() & SCDB_IsSized) != 0)
568 return true;
569 if (isOpaque())
570 return false;
571
572 if (Visited && !Visited->insert(const_cast<StructType*>(this)).second)
573 return false;
574
575 // Okay, our struct is sized if all of the elements are, but if one of the
576 // elements is opaque, the struct isn't sized *yet*, but may become sized in
577 // the future, so just bail out without caching.
578 for (Type *Ty : elements()) {
579 // If the struct contains a scalable vector type, don't consider it sized.
580 // This prevents it from being used in loads/stores/allocas/GEPs.
581 if (isa<ScalableVectorType>(Ty))
582 return false;
583 if (!Ty->isSized(Visited))
584 return false;
585 }
586
587 // Here we cheat a bit and cast away const-ness. The goal is to memoize when
588 // we find a sized type, as types can only move from opaque to sized, not the
589 // other way.
590 const_cast<StructType*>(this)->setSubclassData(
591 getSubclassData() | SCDB_IsSized);
592 return true;
593}
594
596 assert(!isLiteral() && "Literal structs never have names");
597 if (!SymbolTableEntry) return StringRef();
598
599 return ((StringMapEntry<StructType*> *)SymbolTableEntry)->getKey();
600}
601
603 return !ElemTy->isVoidTy() && !ElemTy->isLabelTy() &&
604 !ElemTy->isMetadataTy() && !ElemTy->isFunctionTy() &&
605 !ElemTy->isTokenTy();
606}
607
609 if (this == Other) return true;
610
611 if (isPacked() != Other->isPacked())
612 return false;
613
614 return elements() == Other->elements();
615}
616
618 unsigned Idx = (unsigned)cast<Constant>(V)->getUniqueInteger().getZExtValue();
619 assert(indexValid(Idx) && "Invalid structure index!");
620 return getElementType(Idx);
621}
622
623bool StructType::indexValid(const Value *V) const {
624 // Structure indexes require (vectors of) 32-bit integer constants. In the
625 // vector case all of the indices must be equal.
626 if (!V->getType()->isIntOrIntVectorTy(32))
627 return false;
628 if (isa<ScalableVectorType>(V->getType()))
629 return false;
630 const Constant *C = dyn_cast<Constant>(V);
631 if (C && V->getType()->isVectorTy())
632 C = C->getSplatValue();
633 const ConstantInt *CU = dyn_cast_or_null<ConstantInt>(C);
634 return CU && CU->getZExtValue() < getNumElements();
635}
636
638 return C.pImpl->NamedStructTypes.lookup(Name);
639}
640
641//===----------------------------------------------------------------------===//
642// ArrayType Implementation
643//===----------------------------------------------------------------------===//
644
645ArrayType::ArrayType(Type *ElType, uint64_t NumEl)
646 : Type(ElType->getContext(), ArrayTyID), ContainedType(ElType),
647 NumElements(NumEl) {
648 ContainedTys = &ContainedType;
649 NumContainedTys = 1;
650}
651
652ArrayType *ArrayType::get(Type *ElementType, uint64_t NumElements) {
653 assert(isValidElementType(ElementType) && "Invalid type for array element!");
654
655 LLVMContextImpl *pImpl = ElementType->getContext().pImpl;
656 ArrayType *&Entry =
657 pImpl->ArrayTypes[std::make_pair(ElementType, NumElements)];
658
659 if (!Entry)
660 Entry = new (pImpl->Alloc) ArrayType(ElementType, NumElements);
661 return Entry;
662}
663
665 return !ElemTy->isVoidTy() && !ElemTy->isLabelTy() &&
666 !ElemTy->isMetadataTy() && !ElemTy->isFunctionTy() &&
667 !ElemTy->isTokenTy() && !ElemTy->isX86_AMXTy() &&
668 !isa<ScalableVectorType>(ElemTy);
669}
670
671//===----------------------------------------------------------------------===//
672// VectorType Implementation
673//===----------------------------------------------------------------------===//
674
676 : Type(ElType->getContext(), TID), ContainedType(ElType),
677 ElementQuantity(EQ) {
678 ContainedTys = &ContainedType;
679 NumContainedTys = 1;
680}
681
683 if (EC.isScalable())
684 return ScalableVectorType::get(ElementType, EC.getKnownMinValue());
685 else
686 return FixedVectorType::get(ElementType, EC.getKnownMinValue());
687}
688
690 return ElemTy->isIntegerTy() || ElemTy->isFloatingPointTy() ||
691 ElemTy->isPointerTy() || ElemTy->getTypeID() == TypedPointerTyID;
692}
693
694//===----------------------------------------------------------------------===//
695// FixedVectorType Implementation
696//===----------------------------------------------------------------------===//
697
698FixedVectorType *FixedVectorType::get(Type *ElementType, unsigned NumElts) {
699 assert(NumElts > 0 && "#Elements of a VectorType must be greater than 0");
700 assert(isValidElementType(ElementType) && "Element type of a VectorType must "
701 "be an integer, floating point, or "
702 "pointer type.");
703
704 auto EC = ElementCount::getFixed(NumElts);
705
706 LLVMContextImpl *pImpl = ElementType->getContext().pImpl;
707 VectorType *&Entry = ElementType->getContext()
708 .pImpl->VectorTypes[std::make_pair(ElementType, EC)];
709
710 if (!Entry)
711 Entry = new (pImpl->Alloc) FixedVectorType(ElementType, NumElts);
712 return cast<FixedVectorType>(Entry);
713}
714
715//===----------------------------------------------------------------------===//
716// ScalableVectorType Implementation
717//===----------------------------------------------------------------------===//
718
720 unsigned MinNumElts) {
721 assert(MinNumElts > 0 && "#Elements of a VectorType must be greater than 0");
722 assert(isValidElementType(ElementType) && "Element type of a VectorType must "
723 "be an integer, floating point, or "
724 "pointer type.");
725
726 auto EC = ElementCount::getScalable(MinNumElts);
727
728 LLVMContextImpl *pImpl = ElementType->getContext().pImpl;
729 VectorType *&Entry = ElementType->getContext()
730 .pImpl->VectorTypes[std::make_pair(ElementType, EC)];
731
732 if (!Entry)
733 Entry = new (pImpl->Alloc) ScalableVectorType(ElementType, MinNumElts);
734 return cast<ScalableVectorType>(Entry);
735}
736
737//===----------------------------------------------------------------------===//
738// PointerType Implementation
739//===----------------------------------------------------------------------===//
740
742 assert(EltTy && "Can't get a pointer to <null> type!");
743 assert(isValidElementType(EltTy) && "Invalid type for pointer element!");
744
745 LLVMContextImpl *CImpl = EltTy->getContext().pImpl;
746
747 // Automatically convert typed pointers to opaque pointers.
748 if (CImpl->getOpaquePointers())
749 return get(EltTy->getContext(), AddressSpace);
750
751 // Since AddressSpace #0 is the common case, we special case it.
752 PointerType *&Entry = AddressSpace == 0 ? CImpl->PointerTypes[EltTy]
753 : CImpl->ASPointerTypes[std::make_pair(EltTy, AddressSpace)];
754
755 if (!Entry)
756 Entry = new (CImpl->Alloc) PointerType(EltTy, AddressSpace);
757 return Entry;
758}
759
761 LLVMContextImpl *CImpl = C.pImpl;
762 assert(CImpl->getOpaquePointers() &&
763 "Can only create opaque pointers in opaque pointer mode");
764
765 // Since AddressSpace #0 is the common case, we special case it.
766 PointerType *&Entry =
767 AddressSpace == 0
768 ? CImpl->PointerTypes[nullptr]
769 : CImpl->ASPointerTypes[std::make_pair(nullptr, AddressSpace)];
770
771 if (!Entry)
772 Entry = new (CImpl->Alloc) PointerType(C, AddressSpace);
773 return Entry;
774}
775
776PointerType::PointerType(Type *E, unsigned AddrSpace)
777 : Type(E->getContext(), PointerTyID), PointeeTy(E) {
778 ContainedTys = &PointeeTy;
779 NumContainedTys = 1;
780 setSubclassData(AddrSpace);
781}
782
783PointerType::PointerType(LLVMContext &C, unsigned AddrSpace)
784 : Type(C, PointerTyID), PointeeTy(nullptr) {
785 setSubclassData(AddrSpace);
786}
787
788PointerType *Type::getPointerTo(unsigned AddrSpace) const {
789 return PointerType::get(const_cast<Type*>(this), AddrSpace);
790}
791
793 return !ElemTy->isVoidTy() && !ElemTy->isLabelTy() &&
794 !ElemTy->isMetadataTy() && !ElemTy->isTokenTy() &&
795 !ElemTy->isX86_AMXTy();
796}
797
799 return isValidElementType(ElemTy) && !ElemTy->isFunctionTy();
800}
801
802//===----------------------------------------------------------------------===//
803// TargetExtType Implementation
804//===----------------------------------------------------------------------===//
805
806TargetExtType::TargetExtType(LLVMContext &C, StringRef Name,
808 : Type(C, TargetExtTyID), Name(C.pImpl->Saver.save(Name)) {
809 NumContainedTys = Types.size();
810
811 // Parameter storage immediately follows the class in allocation.
812 Type **Params = reinterpret_cast<Type **>(this + 1);
813 ContainedTys = Params;
814 for (Type *T : Types)
815 *Params++ = T;
816
817 setSubclassData(Ints.size());
818 unsigned *IntParamSpace = reinterpret_cast<unsigned *>(Params);
819 IntParams = IntParamSpace;
820 for (unsigned IntParam : Ints)
821 *IntParamSpace++ = IntParam;
822}
823
825 ArrayRef<Type *> Types,
826 ArrayRef<unsigned> Ints) {
827 const TargetExtTypeKeyInfo::KeyTy Key(Name, Types, Ints);
828 TargetExtType *TT;
829 // Since we only want to allocate a fresh target type in case none is found
830 // and we don't want to perform two lookups (one for checking if existent and
831 // one for inserting the newly allocated one), here we instead lookup based on
832 // Key and update the reference to the target type in-place to a newly
833 // allocated one if not found.
834 auto Insertion = C.pImpl->TargetExtTypes.insert_as(nullptr, Key);
835 if (Insertion.second) {
836 // The target type was not found. Allocate one and update TargetExtTypes
837 // in-place.
838 TT = (TargetExtType *)C.pImpl->Alloc.Allocate(
839 sizeof(TargetExtType) + sizeof(Type *) * Types.size() +
840 sizeof(unsigned) * Ints.size(),
841 alignof(TargetExtType));
842 new (TT) TargetExtType(C, Name, Types, Ints);
843 *Insertion.first = TT;
844 } else {
845 // The target type was found. Just return it.
846 TT = *Insertion.first;
847 }
848 return TT;
849}
850
851namespace {
852struct TargetTypeInfo {
853 Type *LayoutType;
854 uint64_t Properties;
855
856 template <typename... ArgTys>
857 TargetTypeInfo(Type *LayoutType, ArgTys... Properties)
858 : LayoutType(LayoutType), Properties((0 | ... | Properties)) {}
859};
860} // anonymous namespace
861
862static TargetTypeInfo getTargetTypeInfo(const TargetExtType *Ty) {
863 LLVMContext &C = Ty->getContext();
864 StringRef Name = Ty->getName();
865 if (Name.startswith("spirv.")) {
866 return TargetTypeInfo(Type::getInt8PtrTy(C, 0), TargetExtType::HasZeroInit,
868 }
869 return TargetTypeInfo(Type::getVoidTy(C));
870}
871
873 return getTargetTypeInfo(this).LayoutType;
874}
875
877 uint64_t Properties = getTargetTypeInfo(this).Properties;
878 return (Properties & Prop) == Prop;
879}
This file defines the StringMap class.
This file implements a class to represent arbitrary precision integral constant values and operations...
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This file contains the declarations for the subclasses of Constant, which represent the different fla...
return RetTy
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
std::string Name
LLVMContext & Context
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallString class.
static TargetTypeInfo getTargetTypeInfo(const TargetExtType *Ty)
Definition: Type.cpp:862
static unsigned getBitWidth(Type *Ty, const DataLayout &DL)
Returns the bitwidth of the given scalar or pointer type.
bool isIEEE() const
Definition: APFloat.h:1248
static APFloat getZero(const fltSemantics &Sem, bool Negative=false)
Factory for Positive and Negative Zero.
Definition: APFloat.h:900
Class for arbitrary precision integers.
Definition: APInt.h:75
static APInt getAllOnes(unsigned numBits)
Return an APInt of a specified width with all bits set.
Definition: APInt.h:214
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:41
size_t size() const
size - Get the array size.
Definition: ArrayRef.h:163
Class to represent array types.
Definition: DerivedTypes.h:357
static bool isValidElementType(Type *ElemTy)
Return true if the specified type is valid as a element type.
Definition: Type.cpp:664
static ArrayType * get(Type *ElementType, uint64_t NumElements)
This static method is the primary way to construct an ArrayType.
Definition: Type.cpp:652
LLVM_ATTRIBUTE_RETURNS_NONNULL void * Allocate(size_t Size, Align Alignment)
Allocate space at the specified alignment.
Definition: Allocator.h:148
This is the shared class of boolean and integer constants.
Definition: Constants.h:78
This is an important base class in LLVM.
Definition: Constant.h:41
static constexpr ElementCount getScalable(ScalarTy MinVal)
Definition: TypeSize.h:294
static constexpr ElementCount getFixed(ScalarTy MinVal)
Definition: TypeSize.h:291
Class to represent fixed width SIMD vectors.
Definition: DerivedTypes.h:525
static FixedVectorType * get(Type *ElementType, unsigned NumElts)
Definition: Type.cpp:698
Class to represent function types.
Definition: DerivedTypes.h:103
static bool isValidArgumentType(Type *ArgTy)
Return true if the specified type is valid as an argument type.
Definition: Type.cpp:410
static bool isValidReturnType(Type *RetTy)
Return true if the specified type is valid as a return type.
Definition: Type.cpp:405
bool isVarArg() const
Definition: DerivedTypes.h:123
static FunctionType * get(Type *Result, ArrayRef< Type * > Params, bool isVarArg)
This static method is the primary way of constructing a FunctionType.
Class to represent integer types.
Definition: DerivedTypes.h:40
@ MIN_INT_BITS
Minimum number of bits that can be specified.
Definition: DerivedTypes.h:51
@ MAX_INT_BITS
Maximum number of bits that can be specified.
Definition: DerivedTypes.h:52
static IntegerType * get(LLVMContext &C, unsigned NumBits)
This static method is the primary way of constructing an IntegerType.
Definition: Type.cpp:325
APInt getMask() const
For example, this is 0xFF for an 8 bit integer, 0xFFFF for i16, etc.
Definition: Type.cpp:349
unsigned getBitWidth() const
Get the number of bits in this IntegerType.
Definition: DerivedTypes.h:72
DenseMap< std::pair< Type *, unsigned >, PointerType * > ASPointerTypes
StructTypeSet AnonStructTypes
DenseMap< Type *, PointerType * > PointerTypes
DenseMap< std::pair< Type *, uint64_t >, ArrayType * > ArrayTypes
BumpPtrAllocator Alloc
DenseMap< std::pair< Type *, ElementCount >, VectorType * > VectorTypes
StringMap< StructType * > NamedStructTypes
FunctionTypeSet FunctionTypes
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:67
LLVMContextImpl *const pImpl
Definition: LLVMContext.h:69
Class to represent pointers.
Definition: DerivedTypes.h:632
static bool isLoadableOrStorableType(Type *ElemTy)
Return true if we can load or store from a pointer to this type.
Definition: Type.cpp:798
static PointerType * get(Type *ElementType, unsigned AddressSpace)
This constructs a pointer to an object of the specified type in a numbered address space.
static bool isValidElementType(Type *ElemTy)
Return true if the specified type is valid as a element type.
Definition: Type.cpp:792
Class to represent scalable SIMD vectors.
Definition: DerivedTypes.h:572
static ScalableVectorType * get(Type *ElementType, unsigned MinNumElts)
Definition: Type.cpp:719
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
Definition: SmallPtrSet.h:344
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
Definition: SmallPtrSet.h:365
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
Definition: SmallString.h:26
void resize(size_type N)
Definition: SmallVector.h:642
void push_back(const T &Elt)
Definition: SmallVector.h:416
StringMapEntry - This is used to represent one value that is inserted into a StringMap.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Definition: StringMap.h:111
void remove(MapEntryTy *KeyValue)
remove - Remove the specified key/value pair from the map, but do not erase it.
Definition: StringMap.h:368
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
Class to represent struct types.
Definition: DerivedTypes.h:213
bool indexValid(const Value *V) const
Definition: Type.cpp:623
bool containsScalableVectorType() const
Returns true if this struct contains a scalable vector.
Definition: Type.cpp:447
static StructType * get(LLVMContext &Context, ArrayRef< Type * > Elements, bool isPacked=false)
This static method is the primary way to create a literal StructType.
Definition: Type.cpp:420
ArrayRef< Type * > elements() const
Definition: DerivedTypes.h:319
void setBody(ArrayRef< Type * > Elements, bool isPacked=false)
Specify a body for an opaque identified type.
Definition: Type.cpp:459
static StructType * getTypeByName(LLVMContext &C, StringRef Name)
Return the type with the specified name, or null if there is none by that name.
Definition: Type.cpp:637
static StructType * create(LLVMContext &Context, StringRef Name)
This creates an identified struct.
Definition: Type.cpp:527
bool isPacked() const
Definition: DerivedTypes.h:273
static bool isValidElementType(Type *ElemTy)
Return true if the specified type is valid as a element type.
Definition: Type.cpp:602
unsigned getNumElements() const
Random access to the elements.
Definition: DerivedTypes.h:327
bool isSized(SmallPtrSetImpl< Type * > *Visited=nullptr) const
isSized - Return true if this is a sized type.
Definition: Type.cpp:566
void setName(StringRef Name)
Change the name of this type to the specified name, or to a name with a suffix if there is a collisio...
Definition: Type.cpp:476
bool isLayoutIdentical(StructType *Other) const
Return true if this is layout identical to the specified struct.
Definition: Type.cpp:608
Type * getTypeAtIndex(const Value *V) const
Given an index value into the type, return the type of the element.
Definition: Type.cpp:617
bool isLiteral() const
Return true if this type is uniqued by structural equivalence, false if it is a struct definition.
Definition: DerivedTypes.h:277
bool isOpaque() const
Return true if this is a type with an identity that has no body specified yet.
Definition: DerivedTypes.h:281
Type * getElementType(unsigned N) const
Definition: DerivedTypes.h:328
StringRef getName() const
Return the name for this struct type if it has an identity.
Definition: Type.cpp:595
Symbol info for RuntimeDyld.
Class to represent target extensions types, which are generally unintrospectable from target-independ...
Definition: DerivedTypes.h:739
static TargetExtType * get(LLVMContext &Context, StringRef Name, ArrayRef< Type * > Types=std::nullopt, ArrayRef< unsigned > Ints=std::nullopt)
Return a target extension type having the specified name and optional type and integer parameters.
Definition: Type.cpp:824
bool hasProperty(Property Prop) const
Returns true if the target extension type contains the given property.
Definition: Type.cpp:876
@ HasZeroInit
zeroinitializer is valid for this target extension type.
Definition: DerivedTypes.h:788
@ CanBeGlobal
This type may be used as the value type of a global variable.
Definition: DerivedTypes.h:790
StringRef getName() const
Return the name for this target extension type.
Definition: DerivedTypes.h:760
Type * getLayoutType() const
Returns an underlying layout type for the target extension type.
Definition: Type.cpp:872
static constexpr TypeSize Fixed(ScalarTy ExactSize)
Definition: TypeSize.h:331
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
static PointerType * getInt32PtrTy(LLVMContext &C, unsigned AS=0)
static PointerType * getFP128PtrTy(LLVMContext &C, unsigned AS=0)
static PointerType * getPPC_FP128PtrTy(LLVMContext &C, unsigned AS=0)
static Type * getHalfTy(LLVMContext &C)
static Type * getDoubleTy(LLVMContext &C)
const fltSemantics & getFltSemantics() const
bool isVectorTy() const
True if this is an instance of VectorType.
Definition: Type.h:258
static Type * getFloatingPointTy(LLVMContext &C, const fltSemantics &S)
static PointerType * getHalfPtrTy(LLVMContext &C, unsigned AS=0)
PointerType * getPointerTo(unsigned AddrSpace=0) const
Return a pointer to the current type.
static PointerType * getInt1PtrTy(LLVMContext &C, unsigned AS=0)
static Type * getX86_FP80Ty(LLVMContext &C)
static PointerType * getX86_FP80PtrTy(LLVMContext &C, unsigned AS=0)
static PointerType * getX86_MMXPtrTy(LLVMContext &C, unsigned AS=0)
bool isLabelTy() const
Return true if this is 'label'.
Definition: Type.h:213
static Type * getBFloatTy(LLVMContext &C)
bool isIntOrIntVectorTy() const
Return true if this is an integer type or a vector of integer types.
Definition: Type.h:228
bool isPointerTy() const
True if this is an instance of PointerType.
Definition: Type.h:249
static PointerType * getBFloatPtrTy(LLVMContext &C, unsigned AS=0)
static IntegerType * getInt1Ty(LLVMContext &C)
bool isEmptyTy() const
Return true if this type is empty, that is, it has no elements or all of its elements are empty.
static Type * getX86_AMXTy(LLVMContext &C)
static Type * getMetadataTy(LLVMContext &C)
TypeID
Definitions of all of the base types for the Type system.
Definition: Type.h:54
@ X86_MMXTyID
MMX vectors (64 bits, X86 specific)
Definition: Type.h:66
@ X86_AMXTyID
AMX vectors (8192 bits, X86 specific)
Definition: Type.h:67
@ TypedPointerTyID
Typed pointer used by some GPU targets.
Definition: Type.h:78
@ HalfTyID
16-bit floating point type
Definition: Type.h:56
@ VoidTyID
type with no size
Definition: Type.h:63
@ ScalableVectorTyID
Scalable SIMD vector type.
Definition: Type.h:77
@ LabelTyID
Labels.
Definition: Type.h:64
@ FloatTyID
32-bit floating point type
Definition: Type.h:58
@ IntegerTyID
Arbitrary bit width integers.
Definition: Type.h:71
@ FixedVectorTyID
Fixed width SIMD vector type.
Definition: Type.h:76
@ BFloatTyID
16-bit floating point type (7-bit significand)
Definition: Type.h:57
@ DoubleTyID
64-bit floating point type
Definition: Type.h:59
@ X86_FP80TyID
80-bit floating point type (X87)
Definition: Type.h:60
@ PPC_FP128TyID
128-bit floating point type (two 64-bits, PowerPC)
Definition: Type.h:62
@ MetadataTyID
Metadata.
Definition: Type.h:65
@ TokenTyID
Tokens.
Definition: Type.h:68
@ FP128TyID
128-bit floating point type (112-bit significand)
Definition: Type.h:61
bool isX86_MMXTy() const
Return true if this is X86 MMX.
Definition: Type.h:201
unsigned NumContainedTys
Keeps track of how many Type*'s there are in the ContainedTys list.
Definition: Type.h:107
static Type * getX86_MMXTy(LLVMContext &C)
static IntegerType * getIntNTy(LLVMContext &C, unsigned N)
unsigned getScalarSizeInBits() const LLVM_READONLY
If this is a vector type, return the getPrimitiveSizeInBits value for the element type.
static Type * getVoidTy(LLVMContext &C)
static Type * getLabelTy(LLVMContext &C)
bool isFirstClassType() const
Return true if the type is "first class", meaning it is a valid type for a Value.
Definition: Type.h:274
static Type * getFP128Ty(LLVMContext &C)
bool isSized(SmallPtrSetImpl< Type * > *Visited=nullptr) const
Return true if it makes sense to take the size of this type.
Definition: Type.h:295
static IntegerType * getInt16Ty(LLVMContext &C)
LLVMContext & getContext() const
Return the LLVMContext in which this type was uniqued.
Definition: Type.h:129
static Type * getPrimitiveType(LLVMContext &C, TypeID IDNumber)
Return a type based on an identifier.
int getFPMantissaWidth() const
Return the width of the mantissa of this type.
Type *const * ContainedTys
A pointer to the array of Types contained by this Type.
Definition: Type.h:114
unsigned getSubclassData() const
Definition: Type.h:98
static IntegerType * getInt8Ty(LLVMContext &C)
bool isIEEE() const
Return whether the type is IEEE compatible, as defined by the eponymous method in APFloat.
static IntegerType * getInt128Ty(LLVMContext &C)
static PointerType * getIntNPtrTy(LLVMContext &C, unsigned N, unsigned AS=0)
static PointerType * getX86_AMXPtrTy(LLVMContext &C, unsigned AS=0)
static PointerType * getDoublePtrTy(LLVMContext &C, unsigned AS=0)
void setSubclassData(unsigned val)
Definition: Type.h:100
static PointerType * getInt8PtrTy(LLVMContext &C, unsigned AS=0)
static Type * getTokenTy(LLVMContext &C)
bool isFloatingPointTy() const
Return true if this is one of the floating-point types.
Definition: Type.h:185
bool isX86_AMXTy() const
Return true if this is X86 AMX.
Definition: Type.h:204
bool isFunctionTy() const
True if this is an instance of FunctionType.
Definition: Type.h:240
bool canLosslesslyBitCastTo(Type *Ty) const
Return true if this type could be converted with a lossless BitCast to type 'Ty'.
static IntegerType * getInt32Ty(LLVMContext &C)
static PointerType * getFloatPtrTy(LLVMContext &C, unsigned AS=0)
static IntegerType * getInt64Ty(LLVMContext &C)
static Type * getFloatTy(LLVMContext &C)
bool isIntegerTy() const
True if this is an instance of IntegerType.
Definition: Type.h:222
TypeID getTypeID() const
Return the type id for the type.
Definition: Type.h:137
static Type * getWasm_FuncrefTy(LLVMContext &C)
bool isTokenTy() const
Return true if this is 'token'.
Definition: Type.h:219
TypeSize getPrimitiveSizeInBits() const LLVM_READONLY
Return the basic size of this type if it is a primitive type.
static PointerType * getInt16PtrTy(LLVMContext &C, unsigned AS=0)
static PointerType * getInt64PtrTy(LLVMContext &C, unsigned AS=0)
static Type * getPPC_FP128Ty(LLVMContext &C)
bool isOpaquePointerTy() const
True if this is an instance of an opaque PointerType.
static Type * getWasm_ExternrefTy(LLVMContext &C)
bool isVoidTy() const
Return true if this is 'void'.
Definition: Type.h:140
Type * getScalarType() const
If this is a vector type, return the element type, otherwise return 'this'.
Definition: Type.h:341
bool isMetadataTy() const
Return true if this is 'metadata'.
Definition: Type.h:216
LLVM Value Representation.
Definition: Value.h:74
Type * getType() const
All values are typed, get the type of this value.
Definition: Value.h:255
Base class of all SIMD vector types.
Definition: DerivedTypes.h:389
static bool isValidElementType(Type *ElemTy)
Return true if the specified type is valid as a element type.
Definition: Type.cpp:689
VectorType(Type *ElType, unsigned EQ, Type::TypeID TID)
Definition: Type.cpp:675
static VectorType * get(Type *ElementType, ElementCount EC)
This static method is the primary way to construct an VectorType.
Definition: Type.cpp:682
std::pair< iterator, bool > insert_as(const ValueT &V, const LookupKeyT &LookupKey)
Alternative version of insert that uses a different (and possibly less expensive) key type.
Definition: DenseSet.h:219
constexpr ScalarTy getFixedValue() const
Definition: TypeSize.h:182
constexpr bool isScalable() const
Returns whether the quantity is scaled by a runtime quantity (vscale).
Definition: TypeSize.h:166
A raw_ostream that writes to an SmallVector or SmallString.
Definition: raw_ostream.h:672
StringRef str() const
Return a StringRef for the vector contents.
Definition: raw_ostream.h:697
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Key
PAL metadata keys.
@ C
The default llvm calling convention, compatible with C.
Definition: CallingConv.h:34
constexpr size_t NameSize
Definition: XCOFF.h:29
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
AddressSpace
Definition: NVPTXBaseInfo.h:21
#define N
#define EQ(a, b)
Definition: regexec.c:112
static const fltSemantics & IEEEsingle() LLVM_READNONE
Definition: APFloat.cpp:201
static const fltSemantics & PPCDoubleDouble() LLVM_READNONE
Definition: APFloat.cpp:208
static const fltSemantics & x87DoubleExtended() LLVM_READNONE
Definition: APFloat.cpp:213
static const fltSemantics & IEEEquad() LLVM_READNONE
Definition: APFloat.cpp:207
static const fltSemantics & IEEEdouble() LLVM_READNONE
Definition: APFloat.cpp:204
static const fltSemantics & IEEEhalf() LLVM_READNONE
Definition: APFloat.cpp:195
static const fltSemantics & BFloat() LLVM_READNONE
Definition: APFloat.cpp:198