[X86] Sort the static memory folding tables by reg opcode. Remove the reg->mem DenseMaps in favor of binary search.

With the static tables sorted we can binary search them directly for reg->mem lookups. This removes 6 DenseMaps that had to be created when X86InstrInfo is constructed.

We still have one Mem->Reg DenseMap for the reverse direction. This is created just as before by walking the reg->mem arrays to populate it.

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

llvm-svn: 335501
This commit is contained in:
Craig Topper 2018-06-25 17:26:56 +00:00
parent b9cb88a4b0
commit 3cc6cb1d35
2 changed files with 5327 additions and 5418 deletions

File diff suppressed because it is too large Load Diff

View File

@ -168,26 +168,13 @@ class X86InstrInfo final : public X86GenInstrInfo {
X86Subtarget &Subtarget;
const X86RegisterInfo RI;
/// RegOp2MemOpTable3Addr, RegOp2MemOpTable0, RegOp2MemOpTable1,
/// RegOp2MemOpTable2, RegOp2MemOpTable3 - Load / store folding opcode maps.
///
typedef DenseMap<unsigned, std::pair<uint16_t, uint16_t>>
RegOp2MemOpTableType;
RegOp2MemOpTableType RegOp2MemOpTable2Addr;
RegOp2MemOpTableType RegOp2MemOpTable0;
RegOp2MemOpTableType RegOp2MemOpTable1;
RegOp2MemOpTableType RegOp2MemOpTable2;
RegOp2MemOpTableType RegOp2MemOpTable3;
RegOp2MemOpTableType RegOp2MemOpTable4;
/// MemOp2RegOpTable - Load / store unfolding opcode map.
///
typedef DenseMap<unsigned, std::pair<uint16_t, uint16_t>>
MemOp2RegOpTableType;
MemOp2RegOpTableType MemOp2RegOpTable;
static void AddTableEntry(RegOp2MemOpTableType &R2MTable,
MemOp2RegOpTableType &M2RTable, uint16_t RegOp,
static void AddTableEntry(MemOp2RegOpTableType &M2RTable, uint16_t RegOp,
uint16_t MemOp, uint16_t Flags);
virtual void anchor();