diff options
author | Heejin Ahn <aheejin@gmail.com> | 2019-01-08 01:15:15 +0000 |
---|---|---|
committer | Heejin Ahn <aheejin@gmail.com> | 2019-01-08 01:15:15 +0000 |
commit | 8e2bac8e7f77a906a407d73524b2d14304d785dd (patch) | |
tree | c11708ad2b2cf4501d5b2ddebb75c397a0e78f72 /llvm/lib | |
parent | ae6f1e07fcc356f0c4a8615d74814c6f8aadbd72 (diff) | |
download | bcm5719-llvm-8e2bac8e7f77a906a407d73524b2d14304d785dd.tar.gz bcm5719-llvm-8e2bac8e7f77a906a407d73524b2d14304d785dd.zip |
[WebAssembly] Use 'I' multiclass template for br_table (NFC)
Summary:
We don't need to explicitly use `NI` anymore because we now don't use
`let` statements within the definitions.
Reviewers: aardappel
Subscribers: dschuff, sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D56376
llvm-svn: 350594
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td index a9ec9257979..7eb6cbf4d24 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td +++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td @@ -42,33 +42,23 @@ def brlist : Operand<i32> { let ParserMatchClass = BrListAsmOperand; let PrintMethod = "printBrList"; } -} // OPERAND_BRLIST -} // OperandNamespace = "WebAssembly" +} // OPERAND_BRLIST +} // OperandNamespace = "WebAssembly" // TODO: SelectionDAG's lowering insists on using a pointer as the index for // jump tables, so in practice we don't ever use BR_TABLE_I64 in wasm32 mode // currently. -// FIXME: this can't inherit from I<> since there is no way to inherit from a -// multiclass and still have the let statements. let isTerminator = 1, hasCtrlDep = 1, isBarrier = 1 in { -let isCodeGenOnly = 1 in -def BR_TABLE_I32 : NI<(outs), (ins I32:$index, variable_ops), - [(WebAssemblybr_table I32:$index)], "false", - "br_table \t$index", 0x0e> { -} -let BaseName = "BR_TABLE_I32" in -def BR_TABLE_I32_S : NI<(outs), (ins brlist:$brl), [], "true", - "br_table \t$brl", 0x0e> { -} -let isCodeGenOnly = 1 in -def BR_TABLE_I64 : NI<(outs), (ins I64:$index, variable_ops), - [(WebAssemblybr_table I64:$index)], "false", - "br_table \t$index"> { -} -let BaseName = "BR_TABLE_I64" in -def BR_TABLE_I64_S : NI<(outs), (ins brlist:$brl), [], "true", - "br_table \t$brl"> { -} +defm BR_TABLE_I32 : I<(outs), (ins I32:$index, variable_ops), + (outs), (ins brlist:$brl), + [(WebAssemblybr_table I32:$index)], + "br_table \t$index", "br_table \t$brl", + 0x0e>; +defm BR_TABLE_I64 : I<(outs), (ins I64:$index, variable_ops), + (outs), (ins brlist:$brl), + [(WebAssemblybr_table I64:$index)], + "br_table \t$index", "br_table \t$brl", + 0x0e>; } // isTerminator = 1, hasCtrlDep = 1, isBarrier = 1 // This is technically a control-flow instruction, since all it affects is the |