[PATCH] D87431: [WebAssembly] Set unreachable as canonical to permit disassembly

Dominic Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 9 22:06:06 PDT 2020


ddcc created this revision.
ddcc added reviewers: dschuff, aheejin, tlively.
Herald added subscribers: ecnelises, sunfish, hiraditya, jgravelle-google, sbc100.
Herald added a project: LLVM.
ddcc requested review of this revision.

Currently, using llvm-objdump to disassemble a function containing
unreachable will trigger an assertion while decoding the opcode, since both
unreachable and debug_unreachable have the same encoding. To avoid this, set
unreachable as the canonical decoding.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87431

Files:
  llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td


Index: llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td
===================================================================
--- llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td
+++ llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td
@@ -103,7 +103,7 @@
 
 } // isReturn = 1
 
-let isTrap = 1 in
+let IsCanonical = 1, isTrap = 1 in
 defm UNREACHABLE : NRI<(outs), (ins), [(trap)], "unreachable", 0x00>;
 
 } // isTerminator = 1


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87431.290870.patch
Type: text/x-patch
Size: 442 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200910/7b79ac2f/attachment.bin>


More information about the llvm-commits mailing list