Skip to content

Commit ba3d174

Browse files
[FuzzMutate] Avoid repeated hash lookups (NFC) (#109903)
1 parent 99cd4cb commit ba3d174

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

llvm/lib/FuzzMutate/IRMutator.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -623,9 +623,11 @@ void ShuffleBlockStrategy::mutate(BasicBlock &BB, RandomIRBuilder &IB) {
623623
auto getAliveChildren = [&AliveInstsLookup](Instruction *I) {
624624
SmallSetVector<size_t, 8> Children;
625625
for (Value *U : I->users()) {
626-
Instruction *P = dyn_cast<Instruction>(U);
627-
if (P && AliveInstsLookup.count(P))
628-
Children.insert(AliveInstsLookup[P]);
626+
if (Instruction *P = dyn_cast<Instruction>(U)) {
627+
auto It = AliveInstsLookup.find(P);
628+
if (It != AliveInstsLookup.end())
629+
Children.insert(It->second);
630+
}
629631
}
630632
return Children;
631633
};

0 commit comments

Comments
 (0)