Skip to content

Commit

Permalink
[TypePromotion] Use return value from SmallPtrSet::insert to avoid a …
Browse files Browse the repository at this point in the history
…call to SmallPtrSet::count. NFC (llvm#103008)
  • Loading branch information
topperc authored Aug 13, 2024
1 parent b1aa0b0 commit dbe8a10
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions llvm/lib/CodeGen/TypePromotion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -834,11 +834,10 @@ bool TypePromotionImpl::TryToPromote(Value *V, unsigned PromotedWidth,
// the tree has already been explored.
// TODO: This could limit the transform, ie if we try to promote something
// from an i8 and fail first, before trying an i16.
if (AllVisited.count(V))
if (!AllVisited.insert(V).second)
return false;

CurrentVisited.insert(V);
AllVisited.insert(V);

// Calls can be both sources and sinks.
if (isSink(V))
Expand Down

0 comments on commit dbe8a10

Please sign in to comment.