Skip to content

[RISCV] Reduce the size of the index used for RVV intrinsics. NFC #74906

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions clang/lib/Sema/SemaRISCVVectorLookup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct RVVIntrinsicDef {

struct RVVOverloadIntrinsicDef {
// Indexes of RISCVIntrinsicManagerImpl::IntrinsicList.
SmallVector<size_t, 8> Indexes;
SmallVector<uint32_t, 8> Indexes;
};

} // namespace
Expand Down Expand Up @@ -162,7 +162,7 @@ class RISCVIntrinsicManagerImpl : public sema::RISCVIntrinsicManager {
// List of all RVV intrinsic.
std::vector<RVVIntrinsicDef> IntrinsicList;
// Mapping function name to index of IntrinsicList.
StringMap<size_t> Intrinsics;
StringMap<uint32_t> Intrinsics;
// Mapping function name to RVVOverloadIntrinsicDef.
StringMap<RVVOverloadIntrinsicDef> OverloadIntrinsics;

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

// Create FunctionDecl for a vector intrinsic.
void CreateRVVIntrinsicDecl(LookupResult &LR, IdentifierInfo *II,
Preprocessor &PP, unsigned Index,
Preprocessor &PP, uint32_t Index,
bool IsOverload);

void ConstructRVVIntrinsics(ArrayRef<RVVIntrinsicRecord> Recs,
Expand Down Expand Up @@ -386,7 +386,7 @@ void RISCVIntrinsicManagerImpl::InitRVVIntrinsic(
Record.HasFRMRoundModeOp);

// Put into IntrinsicList.
size_t Index = IntrinsicList.size();
uint32_t Index = IntrinsicList.size();
IntrinsicList.push_back({BuiltinName, Signature});

// Creating mapping to Intrinsics.
Expand All @@ -403,7 +403,7 @@ void RISCVIntrinsicManagerImpl::InitRVVIntrinsic(
void RISCVIntrinsicManagerImpl::CreateRVVIntrinsicDecl(LookupResult &LR,
IdentifierInfo *II,
Preprocessor &PP,
unsigned Index,
uint32_t Index,
bool IsOverload) {
ASTContext &Context = S.Context;
RVVIntrinsicDef &IDef = IntrinsicList[Index];
Expand Down