Skip to content

Commit 7c7cebf

Browse files
[Scalar] Avoid repeated hash lookups (NFC) (#130463)
1 parent 7cd3047 commit 7c7cebf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Transforms/Scalar/StructurizeCFG.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -852,10 +852,11 @@ void StructurizeCFG::setPhiValues() {
852852
BasicBlock *To = AddedPhi.first;
853853
const BBVector &From = AddedPhi.second;
854854

855-
if (!DeletedPhis.count(To))
855+
auto It = DeletedPhis.find(To);
856+
if (It == DeletedPhis.end())
856857
continue;
857858

858-
PhiMap &Map = DeletedPhis[To];
859+
PhiMap &Map = It->second;
859860
SmallVector<BasicBlock *> &UndefBlks = UndefBlksMap[To];
860861
for (const auto &[Phi, Incoming] : Map) {
861862
Value *Undef = UndefValue::get(Phi->getType());

0 commit comments

Comments
 (0)