[llvm] 2394eb1 - [TargetParser] Avoid repeated hash lookups (NFC) (#168216)

via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 16 08:08:43 PST 2025


Author: Kazu Hirata
Date: 2025-11-16T08:08:39-08:00
New Revision: 2394eb118045bd47c1c75f9cab42d701221846a0

URL: https://github.com/llvm/llvm-project/commit/2394eb118045bd47c1c75f9cab42d701221846a0
DIFF: https://github.com/llvm/llvm-project/commit/2394eb118045bd47c1c75f9cab42d701221846a0.diff

LOG: [TargetParser] Avoid repeated hash lookups (NFC) (#168216)

Added: 
    

Modified: 
    llvm/lib/TargetParser/PPCTargetParser.cpp

Removed: 
    


################################################################################
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<StringMap<bool>> 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


        


More information about the llvm-commits mailing list