diff options
author | Roman Tereshin <rtereshin@apple.com> | 2018-05-22 19:37:59 +0000 |
---|---|---|
committer | Roman Tereshin <rtereshin@apple.com> | 2018-05-22 19:37:59 +0000 |
commit | 792c45b7cd6667c5e90fe837d5268ea5aff93fbc (patch) | |
tree | fabe3f61853e149d54d0a527fc5312749ed8ee77 /test/TableGen | |
parent | ccf5904d1cf290f7cedface29cf5c4a4708abf85 (diff) | |
download | llvm-792c45b7cd6667c5e90fe837d5268ea5aff93fbc.tar.gz |
[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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333017 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/TableGen')
-rw-r--r-- | test/TableGen/GlobalISelEmitter.td | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/test/TableGen/GlobalISelEmitter.td b/test/TableGen/GlobalISelEmitter.td index de14b78f60c..c1429a8b0ea 100644 --- a/test/TableGen/GlobalISelEmitter.td +++ b/test/TableGen/GlobalISelEmitter.td @@ -239,8 +239,11 @@ def HasC : Predicate<"Subtarget->hasC()"> { let RecomputePerFunction = 1; } //===- Test a pattern with multiple ComplexPatterns in multiple instrs ----===// // -// R19O-NEXT: GIM_Try, /*On fail goto*//*Label [[GROUP_NUM:[0-9]+]]*/ [[GROUP:[0-9]+]], -// R19O-NEXT: GIM_CheckOpcode, /*MI*/0, TargetOpcode::G_SELECT, +// R19O-NEXT: GIM_SwitchOpcode, /*MI*/0, /*[*/{{[0-9]+}}, {{[0-9]+}}, /*)*//*default:*//*Label [[DEFAULT_NUM:[0-9]+]]*/ [[DEFAULT:[0-9]+]], +// R19O-NEXT: /*TargetOpcode::G_ADD*//*Label [[CASE_ADD_NUM:[0-9]+]]*/ [[CASE_ADD:[0-9]+]], +// R19O: /*TargetOpcode::G_SELECT*//*Label [[CASE_SELECT_NUM:[0-9]+]]*/ [[CASE_SELECT:[0-9]+]], +// R19O: // Label [[CASE_ADD_NUM]]: @[[CASE_ADD]] +// R19O: // Label [[CASE_SELECT_NUM]]: @[[CASE_SELECT]] // // R19C-NEXT: GIM_Try, /*On fail goto*//*Label [[LABEL_NUM:[0-9]+]]*/ [[LABEL:[0-9]+]], // R19N-NEXT: GIM_CheckNumOperands, /*MI*/0, /*Expected*/4, @@ -298,8 +301,9 @@ def HasC : Predicate<"Subtarget->hasC()"> { let RecomputePerFunction = 1; } // R19C-NEXT: GIR_Done, // R19C-NEXT: // Label [[LABEL_NUM]]: @[[LABEL]] // -// R19O: GIM_Reject, -// R19O-NEXT: // Label [[GROUP_NUM]]: @[[GROUP]] +// R19O: // Label [[DEFAULT_NUM]]: @[[DEFAULT]] +// R19O-NEXT: GIM_Reject, +// R19O-NEXT: }; def INSN3 : I<(outs GPR32:$dst), (ins GPR32Op:$src1, GPR32:$src2a, GPR32:$src2b, GPR32:$scr), []>; @@ -313,8 +317,11 @@ def : Pat<(select GPR32:$src1, (complex_rr GPR32:$src2a, GPR32:$src2b), (INSN4 GPR32:$src3, complex:$src4, i32imm:$src5a, i32imm:$src5b))>; -// R21O-NEXT: GIM_Try, /*On fail goto*//*Label [[GROUP_NUM:[0-9]+]]*/ [[GROUP:[0-9]+]], -// R21O-NEXT: GIM_CheckOpcode, /*MI*/0, TargetOpcode::G_SELECT, +// R21O-NEXT: GIM_SwitchOpcode, /*MI*/0, /*[*/{{[0-9]+}}, {{[0-9]+}}, /*)*//*default:*//*Label [[DEFAULT_NUM:[0-9]+]]*/ [[DEFAULT:[0-9]+]], +// R21O-NEXT: /*TargetOpcode::G_ADD*//*Label [[CASE_ADD_NUM:[0-9]+]]*/ [[CASE_ADD:[0-9]+]], +// R21O: /*TargetOpcode::G_SELECT*//*Label [[CASE_SELECT_NUM:[0-9]+]]*/ [[CASE_SELECT:[0-9]+]], +// R21O: // Label [[CASE_ADD_NUM]]: @[[CASE_ADD]] +// R21O: // Label [[CASE_SELECT_NUM]]: @[[CASE_SELECT]] // // R21C-NEXT: GIM_Try, /*On fail goto*//*Label [[PREV_NUM:[0-9]+]]*/ [[PREV:[0-9]+]], // Rule ID 19 // // R21C-NOT: GIR_Done, @@ -353,8 +360,10 @@ def : Pat<(select GPR32:$src1, (complex_rr GPR32:$src2a, GPR32:$src2b), // R21C-NEXT: GIR_Done, // R21C-NEXT: // Label [[LABEL_NUM]]: @[[LABEL]] // -// R21O-NEXT: GIM_Reject, -// R21O-NEXT: // Label [[GROUP_NUM]]: @[[GROUP]] +// R21O-NEXT: GIM_Reject, +// R21O: // Label [[DEFAULT_NUM]]: @[[DEFAULT]] +// R21O-NEXT: GIM_Reject, +// R21O-NEXT: }; //===- Test a pattern with ComplexPattern operands. -----------------------===// // |