[lld] Ensure NoTrapAfterNoreturn is false for the wasm backend (PR #65876)
Heejin Ahn via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 4 23:10:44 PDT 2023
================
@@ -95,57 +92,4 @@ define i32 @missing_ret_noreturn_unreachable() {
; CHECK-NEXT: end_function
call void @ext_never_return()
unreachable
-}
-
-; We could emit no instructions at all for the llvm unreachables in these next
-; three tests, as the signatures match and reaching llvm unreachable is
-; undefined behaviour. But currently, wasm unreachable is emitted for them.
-
-define void @void_sig_match_unreachable() {
-; CHECK-LABEL: void_sig_match_unreachable:
-; CHECK: .functype void_sig_match_unreachable () -> ()
-; CHECK-NEXT: # %bb.0:
-; CHECK-NEXT: call ext_func
-; CHECK-NEXT: unreachable
-; CHECK-NEXT: end_function
- call void @ext_func()
- unreachable
-}
-
-define i32 @i32_sig_match_unreachable() {
-; CHECK-LABEL: i32_sig_match_unreachable:
-; CHECK: .functype i32_sig_match_unreachable () -> (i32)
-; CHECK-NEXT: # %bb.0:
-; CHECK-NEXT: call ext_func_i32
-; CHECK-NEXT: drop
-; CHECK-NEXT: unreachable
-; CHECK-NEXT: end_function
- call i32 @ext_func_i32()
- unreachable
-}
-
-define void @void_sig_match_noreturn_unreachable() {
-; CHECK-LABEL: void_sig_match_noreturn_unreachable:
-; CHECK: .functype void_sig_match_noreturn_unreachable () -> ()
-; CHECK-NEXT: # %bb.0:
-; CHECK-NEXT: call ext_never_return
-; CHECK-NEXT: unreachable
-; CHECK-NEXT: end_function
- call void @ext_never_return()
- unreachable
-}
-
-; This function currently doesn't emit wasm unreachable, even though the final
-; "ret void" instruction is dead code and could be replaced with an llvm
-; unreachable. Compare and contrast with the above function,
-; @void_sig_match_noreturn_unreachable().
-define void @void_sig_match_noreturn_ret() {
-; CHECK-LABEL: void_sig_match_noreturn_ret:
-; CHECK: .functype void_sig_match_noreturn_ret () -> ()
-; CHECK-NEXT: # %bb.0:
-; CHECK-NEXT: call ext_never_return
-; CHECK-NEXT: # fallthrough-return
-; CHECK-NEXT: end_function
- call void @ext_never_return()
- ret void
-}
+}
----------------
aheejin wrote:
No newline at the end
https://github.com/llvm/llvm-project/pull/65876
More information about the llvm-commits
mailing list