[all-commits] [llvm/llvm-project] d4cdb5: [WebAssembly] Add RefTypeMem2Local pass (#81965)

Heejin Ahn via All-commits all-commits at lists.llvm.org
Tue Feb 27 14:00:55 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d4cdb516eee49ecaf36380af4d8f923cc475e1d7
      https://github.com/llvm/llvm-project/commit/d4cdb516eee49ecaf36380af4d8f923cc475e1d7
  Author: Heejin Ahn <aheejin at gmail.com>
  Date:   2024-02-27 (Tue, 27 Feb 2024)

  Changed paths:
    M llvm/lib/Target/WebAssembly/CMakeLists.txt
    M llvm/lib/Target/WebAssembly/WebAssembly.h
    A llvm/lib/Target/WebAssembly/WebAssemblyRefTypeMem2Local.cpp
    M llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
    A llvm/test/CodeGen/WebAssembly/ref-type-mem2local.ll

  Log Message:
  -----------
  [WebAssembly] Add RefTypeMem2Local pass (#81965)

This adds `WebAssemblyRefTypeMem2Local` pass, which changes the address
spaces of reference type `alloca`s to `addrspace(1)`. This in turn
changes the address spaces of all `load` and `store` instructions that
use the `alloca`s.

`addrspace(1)` is `WASM_ADDRESS_SPACE_VAR`, and loads and stores to this
address space become `local.get`s and `local.set`s, thanks to the Wasm
local IR support added in

https://github.com/llvm/llvm-project/commit/82f92e35c6464e23859c29422956caaceb623967.

In a follow-up PR, I am planning to replace the usage of mem2reg pass
with this to solve the reference type `alloca` problems described in
#81575.



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