[RegisterBankInfo] Avoid heap allocation in most cases.
authorQuentin Colombet <qcolombet@apple.com>
Mon, 19 Sep 2016 17:33:55 +0000 (17:33 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Mon, 19 Sep 2016 17:33:55 +0000 (17:33 +0000)
commita7330ba5ac04eb0163ac6d5bcd5c59a71bcc107e
tree5c73515bccc647ed9d6b93413afc4b29e3f8b8a2
parent042acb2cf7384a011464551ed489a1a539509d66
[RegisterBankInfo] Avoid heap allocation in most cases.

The OperandsMapper class is used heavy in RegBankSelect and each
instantiation triggered a heap allocation for the array of operands.
Instead, use a SmallVector with a big enough size such that most of the
cases do not have to use dynamically allocated memory.

This improves the compile time of the RegBankSelect pass.

llvm-svn: 281916
llvm/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h
llvm/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp