Skip to content

Commit 0523bf1

Browse files
authored
[RISCV] Reduce the size of the index used for RVV intrinsics. NFC (#74906)
Rather than using size_t, use uint32_t. We don't have more than 4 billion intrinsics.
1 parent dd95877 commit 0523bf1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

clang/lib/Sema/SemaRISCVVectorLookup.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ struct RVVIntrinsicDef {
4343

4444
struct RVVOverloadIntrinsicDef {
4545
// Indexes of RISCVIntrinsicManagerImpl::IntrinsicList.
46-
SmallVector<size_t, 8> Indexes;
46+
SmallVector<uint32_t, 8> Indexes;
4747
};
4848

4949
} // namespace
@@ -162,7 +162,7 @@ class RISCVIntrinsicManagerImpl : public sema::RISCVIntrinsicManager {
162162
// List of all RVV intrinsic.
163163
std::vector<RVVIntrinsicDef> IntrinsicList;
164164
// Mapping function name to index of IntrinsicList.
165-
StringMap<size_t> Intrinsics;
165+
StringMap<uint32_t> Intrinsics;
166166
// Mapping function name to RVVOverloadIntrinsicDef.
167167
StringMap<RVVOverloadIntrinsicDef> OverloadIntrinsics;
168168

@@ -174,7 +174,7 @@ class RISCVIntrinsicManagerImpl : public sema::RISCVIntrinsicManager {
174174

175175
// Create FunctionDecl for a vector intrinsic.
176176
void CreateRVVIntrinsicDecl(LookupResult &LR, IdentifierInfo *II,
177-
Preprocessor &PP, unsigned Index,
177+
Preprocessor &PP, uint32_t Index,
178178
bool IsOverload);
179179

180180
void ConstructRVVIntrinsics(ArrayRef<RVVIntrinsicRecord> Recs,
@@ -386,7 +386,7 @@ void RISCVIntrinsicManagerImpl::InitRVVIntrinsic(
386386
Record.HasFRMRoundModeOp);
387387

388388
// Put into IntrinsicList.
389-
size_t Index = IntrinsicList.size();
389+
uint32_t Index = IntrinsicList.size();
390390
IntrinsicList.push_back({BuiltinName, Signature});
391391

392392
// Creating mapping to Intrinsics.
@@ -403,7 +403,7 @@ void RISCVIntrinsicManagerImpl::InitRVVIntrinsic(
403403
void RISCVIntrinsicManagerImpl::CreateRVVIntrinsicDecl(LookupResult &LR,
404404
IdentifierInfo *II,
405405
Preprocessor &PP,
406-
unsigned Index,
406+
uint32_t Index,
407407
bool IsOverload) {
408408
ASTContext &Context = S.Context;
409409
RVVIntrinsicDef &IDef = IntrinsicList[Index];

0 commit comments

Comments
 (0)