[TableGen] Change std::vector to SmallVector

The size of VTList that is pushed into this container is usually 1, but
often 6 or 7. Change the vector to SmallVector to eliminate frequent
mallocs.  This happens hundreds of thousands of times in each tablegen
execution during the LLVM/clang build.

https://reviews.llvm.org/D83849
This commit is contained in:
Nadav Rotem 2020-07-15 22:36:32 -07:00
parent 1912ace968
commit b3417d80ae
1 changed files with 1 additions and 1 deletions

View File

@ -190,7 +190,7 @@ private:
struct TypeSetByHwMode : public InfoByHwMode<MachineValueTypeSet> {
using SetType = MachineValueTypeSet;
std::vector<unsigned> AddrSpaces;
SmallVector<unsigned, 16> AddrSpaces;
TypeSetByHwMode() = default;
TypeSetByHwMode(const TypeSetByHwMode &VTS) = default;