Skip to content

Commit 23a26e7

Browse files
[DFAJumpThreading] Avoid repeated hash lookups (NFC) (#107670)
1 parent 4b676e1 commit 23a26e7

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -502,10 +502,8 @@ struct MainSwitch {
502502
void addToQueue(Value *Val, BasicBlock *BB,
503503
std::deque<std::pair<Value *, BasicBlock *>> &Q,
504504
SmallSet<Value *, 16> &SeenValues) {
505-
if (SeenValues.contains(Val))
506-
return;
507-
Q.push_back({Val, BB});
508-
SeenValues.insert(Val);
505+
if (SeenValues.insert(Val).second)
506+
Q.push_back({Val, BB});
509507
}
510508

511509
bool isValidSelectInst(SelectInst *SI) {

0 commit comments

Comments
 (0)