OSDN Git Service

[X86] Create X86InstrFMA3Group objects fully in a static table instead of on the...
authorCraig Topper <craig.topper@intel.com>
Mon, 18 Jun 2018 06:32:22 +0000 (06:32 +0000)
committerCraig Topper <craig.topper@intel.com>
Mon, 18 Jun 2018 06:32:22 +0000 (06:32 +0000)
commitc6145b53bbcad31b80a7fc53fcf9ab2ae5978173
tree59277b549b81b169084c884ad804186794cfb812
parent3f833442570a1545df0f7ef9c1ff1f3155b984a5
[X86] Create X86InstrFMA3Group objects fully in a static table instead of on the heap. NFCI

Previously we heap allocated the X86InstrFMA3Group objects which were created by passing them small register/memory opcode arrays that existed as individual static tables.

Rather than a bunch of small static arrays we now have one large static table of X86InstrFMA3Group objects. Rather than storing a pointer to the opcode arrays in the X86InstrFMA3Group object, we now store have a register and memory array as part of the object. If a group doesn't have memory or register opcodes, the array entries will be 0.

This greatly simplifies the destruction of the X86InstrFMA3Info object. We no longer need to delete the X86InstrFMA3Group objects as we destruct the DenseMap. And we don't need to keep track of which ones we already deleted.

This reduces the llc binary size on my local machine by ~50k. I can only assume that's really due to the fact that we had something like 512 small static arrays that we passed to the init functions either one at a time or in pairs. So there were between 256 and 512 distinct calls to the init functions in the initOnceImpl method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334925 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86InstrFMA3Info.cpp
lib/Target/X86/X86InstrFMA3Info.h