[clang] [RISCV] Cache required extensions string for RVVIntrinsicDef (PR #143503)

Craig Topper via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 10 08:56:39 PDT 2025


================
@@ -385,7 +390,8 @@ void RISCVIntrinsicManagerImpl::InitRVVIntrinsic(
   uint32_t Index = IntrinsicList.size();
   assert(IntrinsicList.size() == (size_t)Index &&
          "Intrinsics indices overflow.");
-  IntrinsicList.push_back({BuiltinName, Record.RequiredExtensions, Signature});
+  IntrinsicList.push_back(
+      {BuiltinName, StrPool.save(Record.RequiredExtensions), Signature});
----------------
topperc wrote:

Why do we need the StringSaver? `Record.RequiredExtensions` should already point to a single global string in the `.rodata` that was uniqued by the linker. We can just make a StringRef from that.

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


More information about the cfe-commits mailing list