[PowerPC] Avoid repeated hash lookups (NFC) (#130390)
diff --git a/llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp b/llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp
index 0930206..a86da81 100644
--- a/llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp
+++ b/llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp
@@ -241,9 +241,11 @@
++NumBoolCallPromotion;
++NumBoolToIntPromotion;
- for (Value *V : Defs)
- if (!BoolToIntMap.count(V))
- BoolToIntMap[V] = translate(V);
+ for (Value *V : Defs) {
+ auto [It, Inserted] = BoolToIntMap.try_emplace(V);
+ if (Inserted)
+ It->second = translate(V);
+ }
// Replace the operands of the translated instructions. They were set to
// zero in the translate function.