[PATCH] D55401: [WebAssembly] Fix assembler parsing of br_table.

Wouter van Oortmerssen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 6 16:51:03 PST 2018


aardappel created this revision.
aardappel added reviewers: dschuff, aheejin, sunfish.
Herald added subscribers: llvm-commits, kristof.beyls, jgravelle-google, sbc100, javed.absar.

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/master/lib/Target/ARM/ARMInstrInfo.td#L550
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.


Repository:
  rL LLVM

https://reviews.llvm.org/D55401

Files:
  lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
  lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp
  lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.h
  lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCCodeEmitter.cpp
  lib/Target/WebAssembly/WebAssemblyInstrControl.td
  test/CodeGen/WebAssembly/stack-insts.ll
  test/MC/WebAssembly/basic-assembly.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55401.177086.patch
Type: text/x-patch
Size: 9391 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181207/eaa1a9a5/attachment.bin>


More information about the llvm-commits mailing list