Skip to content

Commit 380b8a6

Browse files
committed
[DFAJumpThreading] Use SmallPtrSet for Visited (NFC)
This set is only used for contains checks, so there is no need to use std::set.
1 parent 2ab18d5 commit 380b8a6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ struct ClonedBlock {
349349

350350
typedef std::deque<BasicBlock *> PathType;
351351
typedef std::vector<PathType> PathsType;
352-
typedef std::set<const BasicBlock *> VisitedBlocks;
352+
typedef SmallPtrSet<const BasicBlock *, 8> VisitedBlocks;
353353
typedef std::vector<ClonedBlock> CloneList;
354354

355355
// This data structure keeps track of all blocks that have been cloned. If two
@@ -631,7 +631,7 @@ struct AllSwitchPaths {
631631
}
632632

633633
// We have encountered a cycle, do not get caught in it
634-
if (Visited.find(Succ) != Visited.end())
634+
if (Visited.contains(Succ))
635635
continue;
636636

637637
PathsType SuccPaths = paths(Succ, Visited, PathDepth + 1);

0 commit comments

Comments
 (0)