[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)
commitfd2c6a3be0add6eb3dce3c55f5a485f1ea688088
tree65e294263b37af0f924ff63ae433c790ce9ff9b9
parent869cd5f1c84f370a206dfd7e71c80919c61ebe2e
[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.

llvm-svn: 256669
llvm/include/llvm/Target/Target.td
llvm/lib/Target/Hexagon/Hexagon.td
llvm/utils/TableGen/AsmMatcherEmitter.cpp