Skip to content

Commit a2f659c

Browse files
[StructurizeCFG] Avoid repeated hash lookups (NFC) (#107797)
1 parent ab95ed5 commit a2f659c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/lib/Transforms/Scalar/StructurizeCFG.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,10 +697,9 @@ void StructurizeCFG::findUndefBlocks(
697697
// undefined value for the PHI being reconstructed.
698698
while (!Stack.empty()) {
699699
BasicBlock *Current = Stack.pop_back_val();
700-
if (VisitedBlock.contains(Current))
700+
if (!VisitedBlock.insert(Current).second)
701701
continue;
702702

703-
VisitedBlock.insert(Current);
704703
if (FlowSet.contains(Current)) {
705704
for (auto P : predecessors(Current))
706705
Stack.push_back(P);

0 commit comments

Comments
 (0)