[TypePromotion] Use return value from SmallPtrSet::insert to avoid a call to SmallPtrSet::count. NFC (#103008)

This commit is contained in:
Craig Topper 2024-08-13 10:14:07 -07:00 committed by GitHub
parent b1aa0b0b88
commit dbe8a10c06
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -834,11 +834,10 @@ bool TypePromotionImpl::TryToPromote(Value *V, unsigned PromotedWidth,
// the tree has already been explored. // the tree has already been explored.
// TODO: This could limit the transform, ie if we try to promote something // TODO: This could limit the transform, ie if we try to promote something
// from an i8 and fail first, before trying an i16. // from an i8 and fail first, before trying an i16.
if (AllVisited.count(V)) if (!AllVisited.insert(V).second)
return false; return false;
CurrentVisited.insert(V); CurrentVisited.insert(V);
AllVisited.insert(V);
// Calls can be both sources and sinks. // Calls can be both sources and sinks.
if (isSink(V)) if (isSink(V))