[clang] [RISCV][clang] Optimize memory usage of intrinsic lookup table (PR #77487)

Craig Topper via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 14 23:51:25 PST 2024


================
@@ -463,7 +464,7 @@ void RISCVIntrinsicManagerImpl::CreateRVVIntrinsicDecl(LookupResult &LR,
 bool RISCVIntrinsicManagerImpl::CreateIntrinsicIfFound(LookupResult &LR,
                                                        IdentifierInfo *II,
                                                        Preprocessor &PP) {
-  StringRef Name = II->getName();
+  StringRef Name = II->getName().substr(8);
----------------
topperc wrote:

Or are you assuming that if the string doesn't start with "__riscv" then we'll produce a garbage string that won't match something in `OverloadIntrinsics`?

https://github.com/llvm/llvm-project/pull/77487


More information about the cfe-commits mailing list