[TableGen] Modify the AsmMatcherEmitter to only apply the table growth from r252440...
authorCraig Topper <craig.topper@gmail.com>
Thu, 31 Dec 2015 08:18:23 +0000 (08:18 +0000)
committerCraig Topper <craig.topper@gmail.com>
Thu, 31 Dec 2015 08:18:23 +0000 (08:18 +0000)
commit5ef134945b5288c7df5998986090822b882de777
treea1ed8a8c4fe8a1bb27a7eba91644d955d8610e29
parent1159059a9126ddf7bc0b4caed475c1734899c054
[TableGen] Modify the AsmMatcherEmitter to only apply the table growth from r252440 to the Hexagon target.

This restores the previous behavior of not including the mnemonic in the classes table for every target that starts instruction lines with the mnemonic. Not only did the table size increase by 1 entry, but the class enum increased in size which caused every class in the array to increase in size. It also grew the size of the function that parsers tokens into classes by a substantial amount.

This adds a new HasMnemonicFirst flag to all AsmParsers. It's set to 1 by default and Hexagon target overrides it to 0.

For the X86 target alone this recovers 324KB of size on the llvm-mc executable.

I believe the current state is still a bad design choice for the Hexagon target as it causes most of the parsing to do a linear search through the entire match table to comparing operands against every instruction until it finds one that works. At least for the other targets we do a binary search based on mnemonic over which to do the linear scan.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256669 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Target/Target.td
lib/Target/Hexagon/Hexagon.td
utils/TableGen/AsmMatcherEmitter.cpp