[llvm] 4252f30 - [WebAssembly] Set unreachable as canonical to permit disassembly

Dominic Chen via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 10 12:08:02 PDT 2020


Author: Dominic Chen
Date: 2020-09-10T15:04:16-04:00
New Revision: 4252f3009b169db250559d6a197b399375f89b27

URL: https://github.com/llvm/llvm-project/commit/4252f3009b169db250559d6a197b399375f89b27
DIFF: https://github.com/llvm/llvm-project/commit/4252f3009b169db250559d6a197b399375f89b27.diff

LOG: [WebAssembly] Set unreachable as canonical to permit disassembly

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.

Differential Revision: https://reviews.llvm.org/D87431

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td
index 171dd9a67beb..63aeb1b46737 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td
@@ -103,7 +103,7 @@ defm FALLTHROUGH_RETURN : I<(outs), (ins variable_ops), (outs), (ins), []>;
 
 } // isReturn = 1
 
-let isTrap = 1 in
+let IsCanonical = 1, isTrap = 1 in
 defm UNREACHABLE : NRI<(outs), (ins), [(trap)], "unreachable", 0x00>;
 
 } // isTerminator = 1


        


More information about the llvm-commits mailing list