[all-commits] [llvm/llvm-project] fc9068: [WebAssemblyLowerEmscriptenEHSjLj] Avoid lifetime ...

Nikita Popov via All-commits all-commits at lists.llvm.org
Tue Jul 29 00:59:18 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fc90685354ca36c935ebb0f315bb18592598a83b
      https://github.com/llvm/llvm-project/commit/fc90685354ca36c935ebb0f315bb18592598a83b
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2025-07-29 (Tue, 29 Jul 2025)

  Changed paths:
    M llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
    A llvm/test/CodeGen/WebAssembly/lower-em-sjlj-alloca.ll
    M llvm/test/CodeGen/WebAssembly/lower-em-sjlj-debuginfo.ll
    M llvm/test/CodeGen/WebAssembly/lower-em-sjlj.ll
    M llvm/test/CodeGen/WebAssembly/lower-wasm-ehsjlj.ll
    M llvm/test/CodeGen/WebAssembly/lower-wasm-sjlj.ll

  Log Message:
  -----------
  [WebAssemblyLowerEmscriptenEHSjLj] Avoid lifetime of phi (#150932)

After #149310 lifetime intrinsics require an alloca argument, an
invariant that this pass can break.

I've fixed this in two ways:
* First, move static allocas into the entry block. Currently, the way
the pass splits the entry block makes all allocas dynamic, which I
assume was not actually intended. This will avoid unnecessary SSA
reconstruction for allocas as well, and thus avoid the problem.
* If this fails (for dynamic allocas) drop all lifetime intrinsics if
any one of them would require a rewrite during SSA reconstruction.

Fixes https://github.com/llvm/llvm-project/issues/150498.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list