[GlobalISel][InstructionSelect] Switching MatchTable over opcodes, perf patch 4
authorRoman Tereshin <rtereshin@apple.com>
Tue, 22 May 2018 19:37:59 +0000 (19:37 +0000)
committerRoman Tereshin <rtereshin@apple.com>
Tue, 22 May 2018 19:37:59 +0000 (19:37 +0000)
commit0ee082f3b9b0d90604a6ea0eb9d7c333d12758c1
tree361770833ee8df234e1f2a993c3db0bc7fb0523c
parentb12f4dec083db8da5d13f839efe0a9441b0cb9d7
[GlobalISel][InstructionSelect] Switching MatchTable over opcodes, perf patch 4

This patch continues a series of patches started by r332907 (reapplied
as r332917)

In this commit we introduce a new matching opcode GIM_SwitchOpcode
that implements a jump table over opcodes and start emitting them for
root instructions.

This is expected to decrease time GlobalISel spends in its
InstructionSelect pass by roughly 20% for an -O0 build as measured on
sqlite3-amalgamation (http://sqlite.org/download.html) targeting
AArch64.

To some degree, we assume here that the opcodes form a dense set,
which is true at the moment for all upstream targets given the
limitations of our rule importing mechanism.

It might not be true for out of tree targets, specifically due to
pseudo's. If so, we might noticeably increase the size of the
MatchTable with this patch due to padding zeros. This will be
addressed later.

Reviewers: qcolombet, dsanders, bogner, aemerson, javed.absar

Reviewed By: qcolombet

Subscribers: rovka, llvm-commits, kristof.beyls

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

llvm-svn: 333017
llvm/include/llvm/CodeGen/GlobalISel/InstructionSelector.h
llvm/include/llvm/CodeGen/GlobalISel/InstructionSelectorImpl.h
llvm/test/TableGen/GlobalISelEmitter.td
llvm/utils/TableGen/GlobalISelEmitter.cpp