Skip to content

Commit eef0dda

Browse files
[PowerPC] Avoid repeated hash lookups (NFC) (#130390)
1 parent 9f83914 commit eef0dda

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,11 @@ class PPCBoolRetToInt : public FunctionPass {
241241
++NumBoolCallPromotion;
242242
++NumBoolToIntPromotion;
243243

244-
for (Value *V : Defs)
245-
if (!BoolToIntMap.count(V))
246-
BoolToIntMap[V] = translate(V);
244+
for (Value *V : Defs) {
245+
auto [It, Inserted] = BoolToIntMap.try_emplace(V);
246+
if (Inserted)
247+
It->second = translate(V);
248+
}
247249

248250
// Replace the operands of the translated instructions. They were set to
249251
// zero in the translate function.

0 commit comments

Comments
 (0)