Skip to content

Conversation

@kazutakahirata
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Mar 17, 2025

@llvm/pr-subscribers-backend-risc-v

Author: Kazu Hirata (kazutakahirata)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/131555.diff

1 Files Affected:

  • (modified) llvm/lib/TargetParser/RISCVISAInfo.cpp (+3-2)
diff --git a/llvm/lib/TargetParser/RISCVISAInfo.cpp b/llvm/lib/TargetParser/RISCVISAInfo.cpp
index ecd397f451c79..f7b487688d352 100644
--- a/llvm/lib/TargetParser/RISCVISAInfo.cpp
+++ b/llvm/lib/TargetParser/RISCVISAInfo.cpp
@@ -839,10 +839,11 @@ void RISCVISAInfo::updateImplication() {
     std::for_each(Range.first, Range.second,
                   [&](const ImpliedExtsEntry &Implied) {
                     const char *ImpliedExt = Implied.ImpliedExt;
-                    if (Exts.count(ImpliedExt))
+                    auto [It, Inserted] = Exts.try_emplace(ImpliedExt);
+                    if (!Inserted)
                       return;
                     auto Version = findDefaultVersion(ImpliedExt);
-                    Exts[ImpliedExt] = *Version;
+                    It->second = *Version;
                     WorkList.push_back(ImpliedExt);
                   });
   }

@kazutakahirata kazutakahirata merged commit e71686e into llvm:main Mar 17, 2025
13 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_001_repeated_hash_lookups_llvm_RISCV branch March 17, 2025 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants