HomePhabricator

Improve SmallPtrSetImpl::count implementation

Authored by serge-sans-paille on May 31 2020, 10:49 PM.

Description

Improve SmallPtrSetImpl::count implementation

Relying on the find method implies a roundtrip to the iterator world, which is
not costless because iterator creation involves a few check to ensure the
iterator is in a valid position (through the SmallPtrSetIteratorImpl::AdvanceIfNotValid
method). It turns out that the result of SmallPtrSetImpl::find_imp is either
valid or the EndPointer, so there's no need to go through that abstraction,
and the compiler cannot guess it.

Differential Revision: https://reviews.llvm.org/D80708

Details

Committed
serge-sans-pailleMay 31 2020, 10:49 PM
Differential Revision
D80708: Improve SmallPtrSetImpl::count implementation
Parents
rGaf38074874c6: Fix strict aliasing warning in msan.cpp
Branches
Unknown
Tags
Unknown