Go to the documentation of this file.
30 : RecordStorage(Storage) {
31 SeenRecords.reserve(4096);
50 CVType Type(SeenRecords[Index.toArrayIndex()]);
59 if (Index.isSimple() || Index.isNoneType())
62 return Index.toArrayIndex() < SeenRecords.size();
74 HashedRecords.clear();
89 "The type record size is not a multiple of 4 bytes which will cause "
90 "misalignment in the output TPI stream!");
93 auto Result = HashedRecords.try_emplace(WeakHash,
nextTypeIndex());
97 Result.first->first.RecordData = RecordData;
98 SeenRecords.push_back(RecordData);
102 TypeIndex ActualTI = Result.first->second;
116 assert(!Fragments.empty());
117 for (
auto C : Fragments)
124 assert(Index.toArrayIndex() < SeenRecords.size() &&
125 "This function cannot be used to insert records!");
130 "The type record size is not a multiple of 4 bytes which will cause "
131 "misalignment in the output TPI stream!");
134 auto Result = HashedRecords.try_emplace(WeakHash, Index.toArrayIndex());
135 if (!Result.second) {
136 Index = Result.first->second;
142 Result.first->first.RecordData =
Record;
145 SeenRecords[Index.toArrayIndex()] =
Record;
This is an optimization pass for GlobalISel generic memory operations.
static const uint32_t FirstNonSimpleIndex
uint32_t capacity() override
static TypeIndex fromArrayIndex(uint32_t Index)
CVType getType(TypeIndex Index) override
The instances of the Type class are immutable: once they are created, they are never changed.
bool replaceType(TypeIndex &Index, CVType Data, bool Stabilize) override
hash_code hash_value(const APFloat &Arg)
See friend declarations above.
A locally hashed type represents a straightforward hash code of a serialized record.
~MergingTypeTableBuilder()
(vector float) vec_cmpeq(*A, *B) C
TypeIndex nextTypeIndex() const
TypeIndex insertRecordBytes(ArrayRef< uint8_t > &Record)
static ArrayRef< uint8_t > stabilize(BumpPtrAllocator &Alloc, ArrayRef< uint8_t > Data)
Optional< TypeIndex > getNext(TypeIndex Prev) override
Allocate memory in an ever growing pool, as if by bump-pointer.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
<%struct.s * > cast struct s *S to sbyte *< sbyte * > sbyte uint cast struct s *agg result to sbyte *< sbyte * > sbyte uint cast struct s *memtmp to sbyte *< sbyte * > sbyte uint ret void llc ends up issuing two memcpy or custom lower memcpy(of small size) to be ldmia/stmia. I think option 2 is better but the current register allocator cannot allocate a chunk of registers at a time. A feasible temporary solution is to use specific physical registers at the lowering time for small(<
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
StringRef - Represent a constant reference to a string, i.e.
uint32_t toArrayIndex() const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
bool contains(TypeIndex Index) override
StringRef getTypeName(TypeIndex Index) override
LLVM_ATTRIBUTE_RETURNS_NONNULL void * Allocate(size_t Size, Align Alignment)
Allocate space at the specified alignment.
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
TypeIndex insertRecordAs(hash_code Hash, ArrayRef< uint8_t > &Record)
Optional< TypeIndex > getFirst() override
TypeIndex insertRecord(ContinuationRecordBuilder &Builder)
ArrayRef< ArrayRef< uint8_t > > records() const
An opaque object representing a hash code.
MergingTypeTableBuilder(BumpPtrAllocator &Storage)