diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2018-01-23 23:05:04 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2018-01-23 23:05:04 +0000 |
commit | cbce2f02e9df04a1f7f292c4a2b8b50321f14fae (patch) | |
tree | 31c75b234822c626138472de0a4c41185576f407 /llvm/lib/Object/WasmObjectFile.cpp | |
parent | 0627a33ed4bd72f77c56ed9ffc34d190d51b4628 (diff) | |
download | llvm-cbce2f02e9df04a1f7f292c4a2b8b50321f14fae.zip llvm-cbce2f02e9df04a1f7f292c4a2b8b50321f14fae.tar.gz llvm-cbce2f02e9df04a1f7f292c4a2b8b50321f14fae.tar.bz2 |
[TableGen] Optimize the regex search.
llvm::Regex is still the slowest regex engine on earth, running it over
all instructions on X86 takes a while. Extract a prefix and use a binary
search to reduce the search space before we resort to regex matching.
There are a couple of caveats here:
- The generic opcodes are outside of the sorted enum. They're handled in an extra loop.
- If there's a top-level bar we can't use the prefix trick.
- We bail on top-level ?. This could be handled, but it's rare.
This brings the time to generate X86GenInstrInfo.inc from 21s to 4.7s on
my machine.
llvm-svn: 323277
Diffstat (limited to 'llvm/lib/Object/WasmObjectFile.cpp')
0 files changed, 0 insertions, 0 deletions