Skip to content

Commit 8789c00

Browse files
[Transforms] Avoid repeated hash lookups (NFC) (#131554)
1 parent b8317df commit 8789c00

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/IPO/AttributorAttributes.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1679,8 +1679,8 @@ ChangeStatus AAPointerInfoFloating::updateImpl(Attributor &A) {
16791679
if (auto *PHI = dyn_cast<PHINode>(Usr)) {
16801680
// Note the order here, the Usr access might change the map, CurPtr is
16811681
// already in it though.
1682-
bool IsFirstPHIUser = !OffsetInfoMap.count(PHI);
1683-
auto &UsrOI = OffsetInfoMap[PHI];
1682+
auto [PhiIt, IsFirstPHIUser] = OffsetInfoMap.try_emplace(PHI);
1683+
auto &UsrOI = PhiIt->second;
16841684
auto &PtrOI = OffsetInfoMap[CurPtr];
16851685

16861686
// Check if the PHI operand has already an unknown offset as we can't

0 commit comments

Comments
 (0)