[lld] Ensure NoTrapAfterNoreturn is false for the wasm backend (PR #65876)

Heejin Ahn via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 3 23:24:51 PDT 2023


================
@@ -1,33 +1,151 @@
-; RUN: llc < %s -asm-verbose=false -verify-machineinstrs | FileCheck %s
-; RUN: llc < %s -asm-verbose=false -fast-isel -fast-isel-abort=1 -verify-machineinstrs | FileCheck %s
+; The assertions in this file were autogenerated by
+; utils/update_llc_test_checks.py, but were hand-edited to add the
+; "end_function" lines to prevent the tests from passing when there
+; are superfluous instructions at the end of a function.
+; You can run update_llc_test_checks.py again, but please keep the
+; "end_function" lines intact when you commit.
 
-; Test that LLVM unreachable instruction and trap intrinsic are lowered to
-; wasm unreachable
+
+; --trap-unreachable and --no-trap-after-noreturn are sensitive and bug-prone
+; options for the WebAssembly back-end as, unlike in many other target
+; architechtures, unreachable code being compiled to a trap instruction (i.e.
+; WebAssembly "unreachable" instruction) is often necessary for the code to
+; pass wasm's validation step. We test that various combinations of
+; these options produce the expected output.
----------------
aheejin wrote:

I think we should be more direct and simple by saying, whatever value you specify for `--trap-unreachable` and `--no-trap-after-noreturn`, they will be ignored and we will do `--trap-unreachable=1` and `--no-trap-after-noreturn=0`. (Doesn't have to be exactly this sentence but something to the same effect.)

The current comment sounds like various combinations might produce different results. They don't.

https://github.com/llvm/llvm-project/pull/65876


More information about the llvm-commits mailing list