[X86] Use a std::vector for the memory unfolding table.
authorCraig Topper <craig.topper@intel.com>
Fri, 29 Jun 2018 17:11:26 +0000 (17:11 +0000)
committerCraig Topper <craig.topper@intel.com>
Fri, 29 Jun 2018 17:11:26 +0000 (17:11 +0000)
commit7c96f051d2ee7f57fd8ae9db192720aded19ceac
tree0881cad2c413d9722ae2ecedaaef03c0424ff839
parent6e16c60f2688789c5735280499da42c2793d09bb
[X86] Use a std::vector for the memory unfolding table.

Previously we used a DenseMap which is costly to set up due to multiple full table rehashes as the size increases and causes the table to be reallocated.

This patch changes the table to a vector of structs. We now walk the reg->mem tables and push new entries in the mem->reg table for each row not marked TB_NO_REVERSE. Once all the table entries have been created, we sort the vector. Then we can use a binary search for lookups.

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

llvm-svn: 335994
llvm/lib/Target/X86/X86InstrInfo.cpp
llvm/lib/Target/X86/X86InstrInfo.h