Skip to content

Commit dbe8a10

Browse files
authored
[TypePromotion] Use return value from SmallPtrSet::insert to avoid a call to SmallPtrSet::count. NFC (#103008)
1 parent b1aa0b0 commit dbe8a10

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/lib/CodeGen/TypePromotion.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -834,11 +834,10 @@ bool TypePromotionImpl::TryToPromote(Value *V, unsigned PromotedWidth,
834834
// the tree has already been explored.
835835
// TODO: This could limit the transform, ie if we try to promote something
836836
// from an i8 and fail first, before trying an i16.
837-
if (AllVisited.count(V))
837+
if (!AllVisited.insert(V).second)
838838
return false;
839839

840840
CurrentVisited.insert(V);
841-
AllVisited.insert(V);
842841

843842
// Calls can be both sources and sinks.
844843
if (isSink(V))

0 commit comments

Comments
 (0)