HomePhabricator

[ADT] Specialize std::swap() for SetVector

Authored by nikic on Jun 19 2020, 11:25 AM.

Description

[ADT] Specialize std::swap() for SetVector

This is intended to address a compile-time regression from
1eddce4177cfddc86d4696b758904443b0b4f193. A SmallPtrSet was
replaced with a SetVector there, which had an unexpected large
compile-time impact. It turns out that this structure is getting
swapped a lot, and previously this used an optimized std::swap()
specialization for SmallPtrSet. Now it ends up using the default,
triple-move based implementation, which is much more expensive.

This patch (partly) addresses the issue by specializing std::swap()
for SetVector.

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

Details

Committed
nikicJul 13 2020, 2:14 PM
Differential Revision
D82230: [ADT] Specialize std::swap() for SetVector
Parents
rG77c9aafc5d85: Retry ""[lldb-vscode] Fix TestVSCode_module""
Branches
Unknown
Tags
Unknown