summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly/WebAssemblyInstrFormats.td
diff options
context:
space:
mode:
authorWouter van Oortmerssen <aardappel@gmail.com>2019-02-05 01:19:45 +0000
committerWouter van Oortmerssen <aardappel@gmail.com>2019-02-05 01:19:45 +0000
commit1a91cb0402270a3ce77a9397abda655384d89a43 (patch)
treec55a16056aad9f18a9e8fde3934cac4409cf9a63 /llvm/lib/Target/WebAssembly/WebAssemblyInstrFormats.td
parent60731071dedd20ca77e2f53d17b148e25d3bf489 (diff)
downloadbcm5719-llvm-1a91cb0402270a3ce77a9397abda655384d89a43.tar.gz
bcm5719-llvm-1a91cb0402270a3ce77a9397abda655384d89a43.zip
[WebAssembly] Make disassembler always emit most canonical name.
Summary: There are a few instructions that all map to the same opcode, so when disassembling, we have to pick one. That was just the first one before (the except_ref variant in the case of "call"), now it is the one marked as IsCanonical in tablegen, or failing that, the shortest name (which is typically the "canonical" one). Also introduced a canonical "end" instruction for this purpose. Reviewers: dschuff, tlively Subscribers: sbc100, jgravelle-google, aheejin, llvm-commits, sunfish Tags: #llvm Differential Revision: https://reviews.llvm.org/D57713 llvm-svn: 353131
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyInstrFormats.td')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyInstrFormats.td3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrFormats.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrFormats.td
index 2a2c79c56d6..aff4d20d8d8 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrFormats.td
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrFormats.td
@@ -22,6 +22,9 @@ class WebAssemblyInst<bits<32> inst, string asmstr, string stack> : StackRel,
let Namespace = "WebAssembly";
let Pattern = [];
let AsmString = asmstr;
+ // When there are multiple instructions that map to the same encoding (in
+ // e.g. the disassembler use case) prefer the one where IsCanonical == 1.
+ bit IsCanonical = 0;
}
// Normal instructions. Default instantiation of a WebAssemblyInst.
OpenPOWER on IntegriCloud