[lld] Ensure NoTrapAfterNoreturn is false for the wasm backend (PR #65876)
Heejin Ahn via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 11 15:34:08 PDT 2023
================
@@ -159,6 +207,9 @@ bool WebAssemblyPeephole::runOnMachineFunction(MachineFunction &MF) {
case WebAssembly::RETURN:
Changed |= maybeRewriteToFallthrough(MI, MBB, MF, MFI, MRI, TII);
break;
+ case WebAssembly::UNREACHABLE:
+ Changed |= eraseDeadCodeAroundUnreachable(MI, MBB);
----------------
aheejin wrote:
+1 on splitting them, but I'm not sure if we should turn `NoTrapAfterNoreturn` off in the first place. The peephole optimization itself can be added regardless of whether we have `NoTrapAfterNoreturn` on or off I guess. (We need to check `noreturn` calls along with `UNREACHABLE`s)
https://github.com/llvm/llvm-project/pull/65876
More information about the llvm-commits
mailing list