aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@sifive.com>2023-12-12 17:40:54 -0800
committerGitHub <noreply@github.com>2023-12-12 17:40:54 -0800
commit0523bf1eca4475edafc8aab830c2ce48b01900c3 (patch)
tree3251f1e036b91671c27babb023e2b9830fb238e2
parentdd9587795811ba21e6ca6ad52b4531e17e6babd6 (diff)
downloadllvm-0523bf1eca4475edafc8aab830c2ce48b01900c3.zip
llvm-0523bf1eca4475edafc8aab830c2ce48b01900c3.tar.gz
llvm-0523bf1eca4475edafc8aab830c2ce48b01900c3.tar.bz2
[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.
-rw-r--r--clang/lib/Sema/SemaRISCVVectorLookup.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaRISCVVectorLookup.cpp b/clang/lib/Sema/SemaRISCVVectorLookup.cpp
index 0d411fc..e4642e4 100644
--- a/clang/lib/Sema/SemaRISCVVectorLookup.cpp
+++ b/clang/lib/Sema/SemaRISCVVectorLookup.cpp
@@ -43,7 +43,7 @@ struct RVVIntrinsicDef {
struct RVVOverloadIntrinsicDef {
// Indexes of RISCVIntrinsicManagerImpl::IntrinsicList.
- SmallVector<size_t, 8> Indexes;
+ SmallVector<uint32_t, 8> Indexes;
};
} // namespace
@@ -162,7 +162,7 @@ private:
// 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;
@@ -174,7 +174,7 @@ private:
// 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,
@@ -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.
@@ -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];