Skip to content

Setup compiler backend for producing wasm32 + simd executables #4019

Closed

Description

@benvanik

I suspect we will be able to reuse a majority of the LLVM AOT infra for producing the wasm32 binaries: it's just an LLVM target arch/format.

The WAMR examples compile with LLVM with --target=wasm32-wasi -msimd128. That should give us a .wasm file (vs. a .dll or .so) we can embed in a wasm flatbuffer (along with the reflection information) or reference as a file.

Activity

  1. added
    compiler/dialects
    enhancement ➕
    hal/cpu
    on Nov 28, 2020
  2. added a commit that references this issue on Feb 6, 2021
  3. self-assigned this
    on Feb 6, 2021
  4. ScottTodd commented on Feb 6, 2021

    @ScottTodd
    Member

    I've started on this. I have a WasmLinkerTool that finds wasm-ld and is able to link something with -iree-llvm-target-triple=wasm32-unknown-unknown. Will need to try out some flags and peek at what it generated to see if the output is usable.

  5. benvanik commented on Feb 6, 2021

    @benvanik
    CollaboratorAuthor

    ooo cool! I think I played with adding a wamr submodule once; didn't get far though :P
    image

  6. ScottTodd commented on Mar 9, 2021

    @ScottTodd
    Member

    The wasm executables we can produce now are usable. Here's a prototype proving that we can call into them and read back the expected outputs using WAMR, which I'll be integrating into IREE's HAL (tracked in other issues): https://gist.github.com/ScottTodd/4d01f92c434e6caebf1bf2b180f02840.

    I haven't looked into simd codegen or runtime support yet, and there is still some room for tweaking flags (--allow-undefined in particular).

  7. added
    platform/web 🌐
    on Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

compiler/dialectsenhancement ➕hal/cpuplatform/web 🌐

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions