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

Matt Harding via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 11 15:42:40 PDT 2023


majaha wrote:

> Do we need `unreachable` after `noreturn` calls?

We do for most cases, because the body of a wasm function has to pass wasm validation. This means that the body has to have the same "type" as the function signature, even if that code is never executed. Wasm `unreachable` is a special kind of instruction that can have any "type", and so it can be used as an easy way to fulfil the operand stack typing requirements.

This is something that native-style architectures don't require, which is kinda what I was getting at with my earlier comment about an UB instruction, to better support these kinds of virtual ISAs.

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


More information about the llvm-commits mailing list