diff options
author | Wouter van Oortmerssen <aardappel@gmail.com> | 2018-12-17 22:04:44 +0000 |
---|---|---|
committer | Wouter van Oortmerssen <aardappel@gmail.com> | 2018-12-17 22:04:44 +0000 |
commit | d3c544aa6ec94aaf143a092cbd1058890863c7dc (patch) | |
tree | 7ef64c5f8edde9082a3382f14c783dc7a6aa380d /llvm/test/CodeGen/WebAssembly/stack-insts.ll | |
parent | 8c9d7729916c143fac07ea69acfff3cb13458278 (diff) | |
download | bcm5719-llvm-d3c544aa6ec94aaf143a092cbd1058890863c7dc.tar.gz bcm5719-llvm-d3c544aa6ec94aaf143a092cbd1058890863c7dc.zip |
[WebAssembly] Fix assembler parsing of br_table.
Summary:
We use `variable_ops` in the tablegen defs to denote the list of
branch targets in `br_table`, but unlike other uses of `variable_ops`
(e.g. call) the these branch targets need to actually be encoded in the
instruction. The existing tables for `variable_ops` cause not operands
to be accepted by the assembly matcher.
Following the example of ARM:
https://github.com/llvm-mirror/llvm/blob/2cc0a7da876c1d8c32775b0119e1e15aaa759b9e/lib/Target/ARM/ARMInstrInfo.td#L550-L555
we introduce a new operand type to capture this list, and we use the
same {} syntax as ARM as well to differentiate them from regular
integer operands.
Also removed definition and use of TSFlags in tablegen defs, since
`br_table` now has a non-variable_ops immediate operand, so the
previous logic of only the variable_ops arguments being labels didn't
make sense anymore.
Reviewers: dschuff, aheejin, sunfish
Subscribers: javed.absar, sbc100, jgravelle-google, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D55401
llvm-svn: 349405
Diffstat (limited to 'llvm/test/CodeGen/WebAssembly/stack-insts.ll')
-rw-r--r-- | llvm/test/CodeGen/WebAssembly/stack-insts.ll | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/test/CodeGen/WebAssembly/stack-insts.ll b/llvm/test/CodeGen/WebAssembly/stack-insts.ll index 0876b4a4279..c4ccdddf406 100644 --- a/llvm/test/CodeGen/WebAssembly/stack-insts.ll +++ b/llvm/test/CodeGen/WebAssembly/stack-insts.ll @@ -8,8 +8,7 @@ declare void @foo1() ; Tests if br_table is printed correctly with a tab. ; CHECK-LABEL: test0: -; CHECK-NOT: br_table0, 1, 0, 1, 0 -; CHECK: br_table 0, 1, 0, 1, 0 +; CHECK: br_table {0, 1, 0, 1, 0} define void @test0(i32 %n) { entry: switch i32 %n, label %sw.epilog [ |