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

Heejin Ahn via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 22 12:56:59 PDT 2023


aheejin wrote:

> The Rust compiler _wants_ to set `TargetOptions.NoTrapAfterNoretun = true` by default, too. This is because it's a conservative way to reduce the file size impact of TrapUnreachable, without turning it off completely.
> 
> The problem is that setting `TargetOptions.NoTrapAfterNoretun = true` causes bugs in the WebAssembly back-end. This PR fixes that.

What you did was to silently ignore `NoTrapAfterNoreturn = true` by overriding it to be `false`. Then how can we support the Rust dev who wants to set `NoTrapAfterNoreturn = true`?

Also, my original question was, if setting `NoTrapAfterNoretun` to true causes invalid code as you pointed out in https://github.com/llvm/llvm-project/pull/65876#issuecomment-1730511244, why does the Rust dev wants to set it to true?

Also there are other inline comments I left. PTAL.

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


More information about the llvm-commits mailing list