]> granicus.if.org Git - llvm/commit
[globalisel][tablegen] Add control-flow to the MatchTable.
authorDaniel Sanders <daniel_l_sanders@apple.com>
Thu, 20 Jul 2017 09:25:44 +0000 (09:25 +0000)
committerDaniel Sanders <daniel_l_sanders@apple.com>
Thu, 20 Jul 2017 09:25:44 +0000 (09:25 +0000)
commit1d22eb0749cf0a47d6b1ac803d5646fc3744085b
treea91317bfbbd6130e5f069934d6fff323328506cb
parent8e3ba0877cbfffa7eddc4ad2b7faed23ba96a017
[globalisel][tablegen] Add control-flow to the MatchTable.

Summary:
This will allow us to merge the various sub-tables into a single table. This is a
compile-time saving at this point. However, this will also enable the optimization
of a table so that similar instructions can be tested together, reducing the time
spent on the matching the code.

The bulk of this patch is a mechanical conversion to the new MatchTable object
which is responsible for tracking label definitions and filling in the index of
the jump targets. It is also responsible for nicely formatting the table.

This was necessary to support the new GIM_Try opcode which takes the index to
jump to if the match should fail. This value is unknown during table
construction and is filled in during emission. To support nesting try-blocks
(although we currently don't emit tables with nested try-blocks), GIM_Reject
has been re-introduced to explicitly exit a try-block or fail the overall match
if there are no active try-blocks.

Reviewers: ab, t.p.northover, qcolombet, rovka, aditya_nandakumar

Reviewed By: rovka

Subscribers: kristof.beyls, igorb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308596 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/GlobalISel/InstructionSelector.h
include/llvm/CodeGen/GlobalISel/InstructionSelectorImpl.h
test/TableGen/GlobalISelEmitter.td
utils/TableGen/GlobalISelEmitter.cpp