Skip to content

Commit caebb45

Browse files
[Transforms] Avoid repeated hash looksup (NFC) (#107727)
1 parent 482e7dc commit caebb45

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,9 @@ static bool processHeaderPhiOperands(BasicBlock *Header, BasicBlock *Latch,
139139
SmallPtrSet<Instruction *, 8> VisitedInstr;
140140

141141
std::function<bool(Instruction * I)> ProcessInstr = [&](Instruction *I) {
142-
if (VisitedInstr.count(I))
142+
if (!VisitedInstr.insert(I).second)
143143
return true;
144144

145-
VisitedInstr.insert(I);
146-
147145
if (AftBlocks.count(I->getParent()))
148146
for (auto &U : I->operands())
149147
if (Instruction *II = dyn_cast<Instruction>(U))

0 commit comments

Comments
 (0)