From 1f98dd10576cdd89af199992ce999a62eab6b77f Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sat, 15 Nov 2025 00:12:48 -0800 Subject: [PATCH] [TargetParser] Avoid repeated hash lookups (NFC) --- llvm/lib/TargetParser/PPCTargetParser.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/llvm/lib/TargetParser/PPCTargetParser.cpp b/llvm/lib/TargetParser/PPCTargetParser.cpp index f74d670df4306..106d07107ac8c 100644 --- a/llvm/lib/TargetParser/PPCTargetParser.cpp +++ b/llvm/lib/TargetParser/PPCTargetParser.cpp @@ -138,8 +138,11 @@ std::optional> getPPCDefaultTargetFeatures(const Triple &T, // The target feature `quadword-atomics` is only supported for 64-bit // POWER8 and above. - if (Features.find("quadword-atomics") != Features.end() && !T.isArch64Bit()) - Features["quadword-atomics"] = false; + if (!T.isArch64Bit()) { + auto It = Features.find("quadword-atomics"); + if (It != Features.end()) + It->second = false; + } return Features; } } // namespace PPC